From: Roan Kattouw Date: Mon, 1 Nov 2010 14:31:32 +0000 (+0000) Subject: (bug 25735) Fix regex error in PHP < 5.2.2 by using old (?P) syntax for named... X-Git-Tag: 1.31.0-rc.0~34154 X-Git-Url: http://git.cyclocoop.org/url?a=commitdiff_plain;h=1bf567fa6b714c21d13fc333ec3b202c34393095;p=lhc%2Fweb%2Fwiklou.git (bug 25735) Fix regex error in PHP < 5.2.2 by using old (?P) syntax for named subpatterns. Patch by Paul Oranje. --- diff --git a/CREDITS b/CREDITS index 5b42a967c8..03e9f82aba 100644 --- a/CREDITS +++ b/CREDITS @@ -118,6 +118,7 @@ following names for their contribution to the product. * Nikolaos S. Karastathis * Olaf Lenz * Paul Copperman +* Paul Oranje * PieRRoMaN * quietust * René Kijewski diff --git a/includes/libs/CSSMin.php b/includes/libs/CSSMin.php index 945adde385..7271b36390 100644 --- a/includes/libs/CSSMin.php +++ b/includes/libs/CSSMin.php @@ -34,7 +34,7 @@ class CSSMin { * result in a 1/3 increase in size. */ const EMBED_SIZE_LIMIT = 24576; - const URL_REGEX = 'url\([\'"]?(?[^\?\)\:\'"]*)\??[^\)\'"]*[\'"]?\)'; + const URL_REGEX = 'url\([\'"]?(?P[^\?\)\:\'"]*)\??[^\)\'"]*[\'"]?\)'; /* Protected Static Members */ @@ -84,7 +84,7 @@ class CSSMin { * @return string Remapped CSS data */ public static function remap( $source, $local, $remote, $embed = true ) { - $pattern = '/((?\s*\/\*\s*\@embed\s*\*\/)(?
[^\;\}]*))?' . self::URL_REGEX . '(?[^;]*)[\;]?/';
+		$pattern = '/((?P\s*\/\*\s*\@embed\s*\*\/)(?P
[^\;\}]*))?' . self::URL_REGEX . '(?P[^;]*)[\;]?/';
 		$offset = 0;
 		while ( preg_match( $pattern, $source, $match, PREG_OFFSET_CAPTURE, $offset ) ) {
 			// Shortcuts