Skip to content
Snippets Groups Projects
Commit 86086818 authored by Peter Rotich's avatar Peter Rotich
Browse files

Merge pull request #1486 from greezybacon/issue/subject-tix-number


thread: Fix regex for ticket # in email subject

Reviewed-By: default avatarPeter Rotich <peter@osticket.com>
parents 2b540d7a 2e01010e
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment