diff --git a/include/class.thread.php b/include/class.thread.php index b57da97133ac53e51f11bb8fd87a3ed6370ef1a6..aa1404d26a8d976bce599bced64e05ce0632b0d6 100644 --- a/include/class.thread.php +++ b/include/class.thread.php @@ -910,7 +910,10 @@ Class ThreadEntry { $match = array(); if ($subject && $mailinfo['email'] - && preg_match("/\b#(\S+)/u", $subject, $match) + // Required `#` followed by one or more of + // punctuation (-) then letters, numbers, and symbols + // (Try not to match closing punctuation (`]`) in [#12345]) + && preg_match("/#((\p{P}*[^\p{C}\p{Z}\p{P}]+)+)/u", $subject, $match) //Lookup by ticket number && ($ticket = Ticket::lookupByNumber($match[1])) //Lookup the user using the email address