Page MenuHomePhabricator

D14186.id34272.diff
No OneTemporary

D14186.id34272.diff

diff --git a/src/applications/diffusion/remarkup/__tests__/DiffusionCommitRemarkupRuleTestCase.php b/src/applications/diffusion/remarkup/__tests__/DiffusionCommitRemarkupRuleTestCase.php
--- a/src/applications/diffusion/remarkup/__tests__/DiffusionCommitRemarkupRuleTestCase.php
+++ b/src/applications/diffusion/remarkup/__tests__/DiffusionCommitRemarkupRuleTestCase.php
@@ -121,6 +121,25 @@
),
),
),
+
+ // After an "@", we should not be recognizing references because these
+ // are username mentions.
+ 'deadbeef' => array(
+ 'embed' => array(
+ ),
+ 'ref' => array(
+ array(
+ 'offset' => 0,
+ 'id' => 'deadbeef',
+ ),
+ ),
+ ),
+ '@deadbeef' => array(
+ 'embed' => array(
+ ),
+ 'ref' => array(
+ ),
+ ),
);
foreach ($cases as $input => $expect) {
diff --git a/src/infrastructure/markup/rule/PhabricatorObjectRemarkupRule.php b/src/infrastructure/markup/rule/PhabricatorObjectRemarkupRule.php
--- a/src/infrastructure/markup/rule/PhabricatorObjectRemarkupRule.php
+++ b/src/infrastructure/markup/rule/PhabricatorObjectRemarkupRule.php
@@ -209,13 +209,14 @@
$boundary = '\\B';
}
- // The "(?<![#-])" prevents us from linking "#abcdef" or similar, and
- // "ABC-T1" (see T5714).
+ // The "(?<![#@-])" prevents us from linking "#abcdef" or similar, and
+ // "ABC-T1" (see T5714), and from matching "@T1" as a task (it is a user)
+ // (see T9479).
// The "\b" allows us to link "(abcdef)" or similar without linking things
// in the middle of words.
- return '((?<![#-])'.$boundary.$prefix.'('.$id.')(?:#([-\w\d]+))?(?!\w))u';
+ return '((?<![#@-])'.$boundary.$prefix.'('.$id.')(?:#([-\w\d]+))?(?!\w))u';
}

File Metadata

Mime Type
text/plain
Expires
Fri, May 24, 9:05 PM (3 w, 2 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6273170
Default Alt Text
D14186.id34272.diff (1 KB)

Event Timeline