1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-20 01:08:50 +02:00

Adding ':' as a supported character in Macros.

Summary: Adding ':' in order to support SA-style smiley conventions (e.g: :allears:) in Phabricator.

Test Plan: Tested working on local Phabricator copy.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D4727
This commit is contained in:
Jerrad Thramer 2013-01-29 14:22:36 -08:00 committed by epriestley
parent 1ebd51aad2
commit fd6a13558f
2 changed files with 5 additions and 5 deletions

View file

@ -39,10 +39,10 @@ final class PhabricatorMacroEditController
if (!strlen($macro->getName())) {
$errors[] = pht('Macro name is required.');
$e_name = pht('Required');
} else if (!preg_match('/^[a-z0-9_-]{3,}$/', $macro->getName())) {
$errors[] = pht('Macro must be at least three characters long and '.
'contain only lowercase letters, digits, hyphen and '.
'underscore.');
} else if (!preg_match('/^[a-z0-9:_-]{3,}$/', $macro->getName())) {
$errors[] = pht(
'Macro must be at least three characters long and contain only '.
'lowercase letters, digits, hyphens, colons and underscores.');
$e_name = pht('Invalid');
} else {
$e_name = null;

View file

@ -10,7 +10,7 @@ final class PhabricatorRemarkupRuleImageMacro
public function apply($text) {
return preg_replace_callback(
'@^([a-zA-Z0-9_\-]+)$@m',
'@^([a-zA-Z0-9:_\-]+)$@m',
array($this, 'markupImageMacro'),
$text);
}