1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-24 14:30:56 +01:00

Fixed image macro with '-' in the name.

Summary:
Fixed the image macro regex not to use '-' as the separator.
Also minor improvement to randomon.

Test Plan:
Tried different image marcors.

Reviewed By: jungejason
Reviewers: jungejason
CC: epriestley, jungejason
Differential Revision: 153
This commit is contained in:
tuomaspelkonen 2011-04-19 20:03:55 -07:00
parent 6baeda8aad
commit 976d1e65df

View file

@ -32,13 +32,12 @@ class PhabricatorRemarkupRuleImageMacro
$this->images[$row->getName()] = $row->getFilePHID();
}
$this->images[self::RANDOM_IMAGE_NAME] = '';
$this->hash = 0;
}
public function apply($text) {
$this->hash = 0;
return preg_replace_callback(
'@\b([a-zA-Z0-9_\-]+)\b@U',
'@\b([a-zA-Z0-9_\-]+)\b@',
array($this, 'markupImageMacro'),
$text);
}