diff --git a/application/utils.inc.php b/application/utils.inc.php index 8ee195e11..340913bf8 100644 --- a/application/utils.inc.php +++ b/application/utils.inc.php @@ -3110,8 +3110,7 @@ TXT $aMentionMatches = []; $sText = html_entity_decode($sText); - preg_match_all('/]*)data-object-class="([^"]*)"\s*data-object-key="([^"]*)"/i', $sText, $aMentionMatches); - + preg_match_all('/]*)data-object-class="([^"]*)"\s.*data-object-key="([^"]*)"/Ui', $sText, $aMentionMatches); foreach ($aMentionMatches[0] as $iMatchIdx => $sCompleteMatch) { $sMatchedClass = $aMentionMatches[2][$iMatchIdx]; $sMatchedId = $aMentionMatches[3][$iMatchIdx]; diff --git a/tests/php-unit-tests/unitary-tests/application/utilsTest.php b/tests/php-unit-tests/unitary-tests/application/utilsTest.php index 955539205..410f15efe 100644 --- a/tests/php-unit-tests/unitary-tests/application/utilsTest.php +++ b/tests/php-unit-tests/unitary-tests/application/utilsTest.php @@ -695,7 +695,7 @@ HTML, ], '1 UserRequest, 1 Person' => [ <<

Beginning

Before link #Test Ticket After link

And @Agatha Christie

End

+

Beginning

Before link #Test Ticket After link

And @Agatha Christie

End

HTML, [ 'UserRequest' => ['12345'],