From 4883069177fbdd4c430661fc47c4669d0b1ff230 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Mon, 7 Feb 2011 12:18:41 -0800 Subject: [PATCH] Fix group regexes that got missed in Nickname::DISPLAY_FMT update: fixes bug where group linking happened, but not actual delivery, when using _underscores_ in the !group_name --- classes/Notice.php | 2 +- plugins/GroupPrivateMessage/GroupPrivateMessagePlugin.php | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/classes/Notice.php b/classes/Notice.php index 2d13828f1f..4522d1fc38 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -964,7 +964,7 @@ class Notice extends Memcached_DataObject $groups = array(); /* extract all !group */ - $count = preg_match_all('/(?:^|\s)!([A-Za-z0-9]{1,64})/', + $count = preg_match_all('/(?:^|\s)!(' . Nickname::DISPLAY_FMT . ')/', strtolower($this->content), $match); if (!$count) { diff --git a/plugins/GroupPrivateMessage/GroupPrivateMessagePlugin.php b/plugins/GroupPrivateMessage/GroupPrivateMessagePlugin.php index 7598b3f2b7..9468423bed 100644 --- a/plugins/GroupPrivateMessage/GroupPrivateMessagePlugin.php +++ b/plugins/GroupPrivateMessage/GroupPrivateMessagePlugin.php @@ -391,8 +391,10 @@ class GroupPrivateMessagePlugin extends Plugin // Look for group tags // FIXME: won't work for remote groups + // @fixme if Notice::saveNew is refactored so we can just pull its list + // of groups between processing and saving, make use of it - $count = preg_match_all('/(?:^|\s)!([A-Za-z0-9]{1,64})/', + $count = preg_match_all('/(?:^|\s)!(' . Nickname::DISPLAY_FMT . ')/', strtolower($notice->content), $match); -- 2.39.5