Don't match @nickname on @nickname@server.com

This commit is contained in:
Mikael Nordfeldth
2016-01-29 15:53:58 +01:00
parent cb40f72c7e
commit 36f099958c
2 changed files with 9 additions and 4 deletions

View File

@@ -858,7 +858,8 @@ function common_find_mentions_raw($text)
PREG_OFFSET_CAPTURE);
$atmatches = array();
preg_match_all('/(?:^|\s+)@(' . Nickname::DISPLAY_FMT . ')\b/',
// the regexp's "(?!\@)" makes sure it doesn't matches the single "@remote" in "@remote@server.com"
preg_match_all('/(?:^|\s+)@(' . Nickname::DISPLAY_FMT . ')\b(?!\@)/',
$text,
$atmatches,
PREG_OFFSET_CAPTURE);