From: Craig Andrews Date: Thu, 27 Aug 2009 16:06:45 +0000 (-0400) Subject: Do not used named capturing groups X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=2dd5a5f86d5242362499c381c8d9519f40a8925b;p=quix0rs-gnu-social.git Do not used named capturing groups I'm not sure all php 5.2's are compiled with a PCRE library that supported named captures. --- diff --git a/lib/util.php b/lib/util.php index 7c1e219138..1e78340579 100644 --- a/lib/util.php +++ b/lib/util.php @@ -413,7 +413,7 @@ function common_replace_urls_callback($text, $callback, $notice_id = null) { // Start off with a regex $regex = '#'. '(?:^|[\s\(\)\[\]\{\}\\\'\\\";]+)(?![\@\!\#])'. - '(?P'. + '('. '(?:'. '(?:'. //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);