From cce786a89f97f15bff49de0a6ff8e4d6b042f130 Mon Sep 17 00:00:00 2001 From: epriestley Date: Fri, 8 Jul 2011 11:21:00 -0700 Subject: [PATCH] Prevent mentions from matching "derp@derp" Summary: See task / comment. Test Plan: https://secure.phabricator.com/file/view/PHID-FILE-f337d112ffe053fdea7d/ Reviewed By: tomo Reviewers: mroch, tomo CC: aran, tomo Differential Revision: 614 --- .../markuprule/mention/PhabricatorRemarkupRuleMention.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/infrastructure/markup/remarkup/markuprule/mention/PhabricatorRemarkupRuleMention.php b/src/infrastructure/markup/remarkup/markuprule/mention/PhabricatorRemarkupRuleMention.php index ccacba0f82..be1b59f83a 100644 --- a/src/infrastructure/markup/remarkup/markuprule/mention/PhabricatorRemarkupRuleMention.php +++ b/src/infrastructure/markup/remarkup/markuprule/mention/PhabricatorRemarkupRuleMention.php @@ -27,8 +27,10 @@ class PhabricatorRemarkupRuleMention public function apply($text) { // NOTE: Negative lookahead for period prevents us from picking up email - // addresses, while allowing constructs like "@tomo, lol". - $regexp = '/@([a-zA-Z0-9]+)\b(?![.])/'; + // addresses, while allowing constructs like "@tomo, lol". The negative + // lookbehind for a word character prevents us from matching "mail@lists" + // while allowing "@tomo/@mroch". + $regexp = '/(?