]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Do not used named capturing groups
authorCraig Andrews <candrews@integralblue.com>
Thu, 27 Aug 2009 16:06:45 +0000 (12:06 -0400)
committerCraig Andrews <candrews@integralblue.com>
Thu, 27 Aug 2009 16:06:45 +0000 (12:06 -0400)
I'm not sure all php 5.2's are compiled with a PCRE library that supported named captures.

lib/util.php

index 7c1e21913801c6ed699d131d818e2d499a3547ee..1e783405794b0c6708da7b94b6f291b1d79f4d40 100644 (file)
@@ -413,7 +413,7 @@ function common_replace_urls_callback($text, $callback, $notice_id = null) {
     // Start off with a regex
     $regex = '#'.
     '(?:^|[\s\(\)\[\]\{\}\\\'\\\";]+)(?![\@\!\#])'.
-    '(?P<url>'.
+    '('.
         '(?:'.
             '(?:'. //Known protocols
                 '(?:'.
@@ -454,7 +454,7 @@ function common_replace_urls_callback($text, $callback, $notice_id = null) {
 }
 
 function callback_helper($matches, $callback, $notice_id) {
-    $url=$matches['url'];
+    $url=$matches[1];
     $left = strpos($matches[0],$url);
     $right = $left+strlen($url);