From: Roan Kattouw Date: Thu, 2 Feb 2012 10:30:57 +0000 (+0000) Subject: (bug 34114) CSSMin::remap() doesn't respect its $embed parameter. Patch by Gilles... X-Git-Tag: 1.31.0-rc.0~24967 X-Git-Url: http://git.cyclocoop.org/%24self?a=commitdiff_plain;h=23ab0f71625bea9dd4befcb739c019095feedc12;p=lhc%2Fweb%2Fwiklou.git (bug 34114) CSSMin::remap() doesn't respect its $embed parameter. Patch by Gilles van den Hoven --- diff --git a/CREDITS b/CREDITS index 3c737ecdb7..93eb73414f 100644 --- a/CREDITS +++ b/CREDITS @@ -108,6 +108,7 @@ following names for their contribution to the product. * FunPika * fomafix * Gero Scholz +* Gilles van den Hoven * Grunny * Harry Burt * Ireas diff --git a/RELEASE-NOTES-1.19 b/RELEASE-NOTES-1.19 index 80ca445ab8..fe367fbbcf 100644 --- a/RELEASE-NOTES-1.19 +++ b/RELEASE-NOTES-1.19 @@ -242,6 +242,7 @@ production. * (bug 33762) QueryPage-based special pages no longer misses *-summary message. * Other sizes links are no longer generated for wikis without a 404 thumbnail handler. * (bug 29454) Enforce byteLimit for page title input on Special:MovePage +* (bug 34114) CSSMin::remap() doesn't respect its $embed parameter === API changes in 1.19 === * Made action=edit less likely to return "unknownerror", by returning the actual error diff --git a/includes/libs/CSSMin.php b/includes/libs/CSSMin.php index 45f256fefb..4f4b28bb0b 100644 --- a/includes/libs/CSSMin.php +++ b/includes/libs/CSSMin.php @@ -116,10 +116,10 @@ class CSSMin { * @param $source string CSS data to remap * @param $local string File path where the source was read from * @param $remote string URL path to the file - * @param $embed ??? + * @param $embedData bool If false, never do any data URI embedding, even if / * @embed * / is found * @return string Remapped CSS data */ - public static function remap( $source, $local, $remote, $embed = true ) { + public static function remap( $source, $local, $remote, $embedData = true ) { $pattern = '/((?P\s*\/\*\s*\@embed\s*\*\/)(?P
[^\;\}]*))?' .
 			self::URL_REGEX . '(?P[^;]*)[\;]?/';
 		$offset = 0;
@@ -166,7 +166,7 @@ class CSSMin {
 				// using Z for the timezone, meaning GMT
 				$url .= '?' . gmdate( 'Y-m-d\TH:i:s\Z', round( filemtime( $file ), -2 ) );
 				// Embedding requires a bit of extra processing, so let's skip that if we can
-				if ( $embed ) {
+				if ( $embedData && $embed ) {
 					$type = self::getMimeType( $file );
 					// Detect when URLs were preceeded with embed tags, and also verify file size is
 					// below the limit