(bug 25735) Fix regex error in PHP < 5.2.2 by using old (?P<name>) syntax for named...
authorRoan Kattouw <catrope@users.mediawiki.org>
Mon, 1 Nov 2010 14:31:32 +0000 (14:31 +0000)
committerRoan Kattouw <catrope@users.mediawiki.org>
Mon, 1 Nov 2010 14:31:32 +0000 (14:31 +0000)
CREDITS
includes/libs/CSSMin.php

diff --git a/CREDITS b/CREDITS
index 5b42a96..03e9f82 100644 (file)
--- 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
index 945adde..7271b36 100644 (file)
@@ -34,7 +34,7 @@ class CSSMin {
         * result in a 1/3 increase in size.
         */
        const EMBED_SIZE_LIMIT = 24576;
-       const URL_REGEX = 'url\([\'"]?(?<file>[^\?\)\:\'"]*)\??[^\)\'"]*[\'"]?\)';
+       const URL_REGEX = 'url\([\'"]?(?P<file>[^\?\)\:\'"]*)\??[^\)\'"]*[\'"]?\)';
        
        /* Protected Static Members */
        
@@ -84,7 +84,7 @@ class CSSMin {
         * @return string Remapped CSS data
         */
        public static function remap( $source, $local, $remote, $embed = true ) {
-               $pattern = '/((?<embed>\s*\/\*\s*\@embed\s*\*\/)(?<pre>[^\;\}]*))?' . self::URL_REGEX . '(?<post>[^;]*)[\;]?/';
+               $pattern = '/((?P<embed>\s*\/\*\s*\@embed\s*\*\/)(?P<pre>[^\;\}]*))?' . self::URL_REGEX . '(?P<post>[^;]*)[\;]?/';
                $offset = 0;
                while ( preg_match( $pattern, $source, $match, PREG_OFFSET_CAPTURE, $offset ) ) {
                        // Shortcuts