]> git.mjollnir.org Git - moodle.git/commitdiff
weblib MDL-21296 added a comment about convert_urls_into_links() causing timeouts
authorAndrew Davis <andrew@affinitysoftware.net>
Wed, 13 Jan 2010 02:19:21 +0000 (02:19 +0000)
committerAndrew Davis <andrew@affinitysoftware.net>
Wed, 13 Jan 2010 02:19:21 +0000 (02:19 +0000)
lib/weblib.php

index e51341e8c500f9fe2627e6eca38a1833cbf189f2..59ceb513b1b5e9f6676c3c6e32c534867ec24a26 100644 (file)
@@ -1742,6 +1742,7 @@ function convert_urls_into_links(&$text) {
         $unicoderegexp = @preg_match('/\pL/u', 'a'); // This will fail silenty, returning false,
     }
 
+    //MDL-21296 - use of unicode modifiers may cause a timeout
     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" class="_blanktarget">\\1</a>', $text);