From: Brion Vibber Date: Tue, 22 Nov 2011 23:20:50 +0000 (+0000) Subject: Functional part of r103978 (d'oh!) plus an update to the ResourceLoader filter cache... X-Git-Tag: 1.31.0-rc.0~26342 X-Git-Url: https://git.cyclocoop.org/%28%28?a=commitdiff_plain;h=956de0db3fe1df44754808f058eb9c0272c7c857;p=lhc%2Fweb%2Fwiklou.git Functional part of r103978 (d'oh!) plus an update to the ResourceLoader filter cache key, so broken entries stuck in cache will be reloaded. --- diff --git a/includes/libs/JavaScriptMinifier.php b/includes/libs/JavaScriptMinifier.php index baf9338542..976c02feb9 100644 --- a/includes/libs/JavaScriptMinifier.php +++ b/includes/libs/JavaScriptMinifier.php @@ -498,19 +498,17 @@ class JavaScriptMinifier { ctype_digit( $ch ) || ( $ch === '.' && $pos + 1 < $length && ctype_digit( $s[$pos + 1] ) ) ) { - $end += strspn( $s, '0123456789', $end ); + $end += strspn( $s, '0123456789', $end, 1 ); $decimal = strspn( $s, '.', $end ); if ($decimal) { - if ( $decimal > 2 ) { - return self::parseError($s, $end, 'The number has too many decimal points' ); - } - $end += strspn( $s, '0123456789', $end + 1 ) + $decimal; + // If there are multiple decimal points, we only deal with the first one. + // A following identifier is illegitimate after a raw . but a . and a property? Legit. + // @fixme elsewhere in the code, if we find an identifier right after this - throw a parse error + $end++; + $end += strspn( $s, '0123456789', $end ); } - $exponent = strspn( $s, 'eE', $end ); + $exponent = strspn( $s, 'eE', $end, 1 ); if( $exponent ) { - if ( $exponent > 1 ) { - return self::parseError($s, $end, 'Number with several E' ); - } $end++; // + sign is optional; - sign is required. diff --git a/includes/resourceloader/ResourceLoader.php b/includes/resourceloader/ResourceLoader.php index 17acbd6650..f64cef70fc 100644 --- a/includes/resourceloader/ResourceLoader.php +++ b/includes/resourceloader/ResourceLoader.php @@ -29,7 +29,7 @@ class ResourceLoader { /* Protected Static Members */ - protected static $filterCacheVersion = 5; + protected static $filterCacheVersion = 6; protected static $requiredSourceProperties = array( 'loadScript' ); /** Array: List of module name/ResourceLoaderModule object pairs */