mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-10 00:42:41 +01: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:
parent
1ebd51aad2
commit
fd6a13558f
2 changed files with 5 additions and 5 deletions
|
@ -39,10 +39,10 @@ final class PhabricatorMacroEditController
|
||||||
if (!strlen($macro->getName())) {
|
if (!strlen($macro->getName())) {
|
||||||
$errors[] = pht('Macro name is required.');
|
$errors[] = pht('Macro name is required.');
|
||||||
$e_name = pht('Required');
|
$e_name = pht('Required');
|
||||||
} else if (!preg_match('/^[a-z0-9_-]{3,}$/', $macro->getName())) {
|
} else if (!preg_match('/^[a-z0-9:_-]{3,}$/', $macro->getName())) {
|
||||||
$errors[] = pht('Macro must be at least three characters long and '.
|
$errors[] = pht(
|
||||||
'contain only lowercase letters, digits, hyphen and '.
|
'Macro must be at least three characters long and contain only '.
|
||||||
'underscore.');
|
'lowercase letters, digits, hyphens, colons and underscores.');
|
||||||
$e_name = pht('Invalid');
|
$e_name = pht('Invalid');
|
||||||
} else {
|
} else {
|
||||||
$e_name = null;
|
$e_name = null;
|
||||||
|
|
|
@ -10,7 +10,7 @@ final class PhabricatorRemarkupRuleImageMacro
|
||||||
|
|
||||||
public function apply($text) {
|
public function apply($text) {
|
||||||
return preg_replace_callback(
|
return preg_replace_callback(
|
||||||
'@^([a-zA-Z0-9_\-]+)$@m',
|
'@^([a-zA-Z0-9:_\-]+)$@m',
|
||||||
array($this, 'markupImageMacro'),
|
array($this, 'markupImageMacro'),
|
||||||
$text);
|
$text);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue