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.
This commit is contained in:
Craig Andrews 2009-08-27 12:06:45 -04:00
parent b7beac36c2
commit 2dd5a5f86d

View File

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