Skip to content
Snippets Groups Projects
Commit a74d9a5c authored by Jared Hancock's avatar Jared Hancock
Browse files

Honor ticket number in subject line without brackets

We introduced a glitch in 29b37144, which was the patch that introduced
matching on email headers other than the Subject.

I misinterpreted the original `preg_match()` regex, thinking that it was
requiring brackets. Looking at it again today, I see that it didn't. The
current one does, however, require surrounding brackets.

This patch also allows for extra letters or dashes between the `#` and the
ticket number. Eventually we should allow the ticket number itself to have
extra characters -- be formattable.

Fixes osTicket/osTicket-1.8#342
parent 8cf68502
No related branches found
No related tags found
No related merge requests found
...@@ -728,7 +728,7 @@ Class ThreadEntry { ...@@ -728,7 +728,7 @@ Class ThreadEntry {
$subject = $mailinfo['subject']; $subject = $mailinfo['subject'];
$match = array(); $match = array();
if ($subject && $mailinfo['email'] if ($subject && $mailinfo['email']
&& preg_match("/\[#([0-9]{1,10})\]/", $subject, $match) && preg_match("/#[\p{L}-]+?([0-9]{1,10})/u", $subject, $match)
&& ($tid = Ticket::getIdByExtId((int)$match[1], $mailinfo['email'])) && ($tid = Ticket::getIdByExtId((int)$match[1], $mailinfo['email']))
) )
// Return last message for the thread // Return last message for the thread
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment