Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix long URL formatting causing bugnote/text to be blank
When MantisCoreFormatting plugin processes text (e.g. bugnote) containing a long URL, a PREG_BACKTRACK_LIMIT_ERROR may occur in string_insert_hrefs() when replacing email address links with preg_replace_callback(). When pcre.backtrack_limit = 100000, the longest URL that can be processed successfully is 152 chars. A bigger URL triggers the PCRE error and the function returns NULL. This was introduced by commit 21a3469. We now use preg_split() instead of preg_replace_callback(), which is more efficient and avoids the backtrace error issue The url replacement string was also moved to a variable to make code more readable. Fixes #14447
- Loading branch information
Showing
1 changed file
with
24 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters