weblib MDL-21296 a temporary workaround convert_urls_into_links() causing timeouts
This commit is contained in:
@@ -2324,6 +2324,7 @@ function convert_urls_into_links(&$text) {
|
||||
$unicoderegexp = @preg_match('/\pL/u', 'a'); // This will fail silenty, returning false,
|
||||
}
|
||||
|
||||
$unicoderegexp = false;//force non use of unicode modifiers. MDL-21296
|
||||
if ($unicoderegexp) { //We can use unicode modifiers
|
||||
$text = preg_replace('#(?<!=["\'])(((http(s?))://)(((([\pLl0-9]([\pLl0-9]|-)*[\pLl0-9]|[\pLl0-9])\.)+([\pLl]([\pLl0-9]|-)*[\pLl0-9]|[\pLl]))|(([0-9]{1,3}\.){3}[0-9]{1,3}))(:[\pL0-9]*)?(/([\pLl0-9\.!$&\'\(\)*+,;=_~:@-]|%[a-fA-F0-9]{2})*)*(\?([\pLl0-9\.!$&\'\(\)*+,;=_~:@/?-]|%[a-fA-F0-9]{2})*)?(\#[\pLl0-9\.!$&\'\(\)*+,;=_~:@/?-]*)?)(?<![,\.;])#iu',
|
||||
'<a href="\\1" target="_blank">\\1</a>', $text);
|
||||
|
||||
Reference in New Issue
Block a user