From 1bf567fa6b714c21d13fc333ec3b202c34393095 Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Mon, 1 Nov 2010 14:31:32 +0000 Subject: [PATCH] (bug 25735) Fix regex error in PHP < 5.2.2 by using old (?P) syntax for named subpatterns. Patch by Paul Oranje. --- CREDITS | 1 + includes/libs/CSSMin.php | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) 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
-- 
2.20.1