From: Trevor Parscal Date: Tue, 15 Feb 2011 00:49:34 +0000 (+0000) Subject: Resolves remaining issues in r82000 with remapping relative CSS URLs that contained... X-Git-Tag: 1.31.0-rc.0~31988 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=64e5faa430ebafe3c2141de8b61b0d745141e590;p=lhc%2Fweb%2Fwiklou.git Resolves remaining issues in r82000 with remapping relative CSS URLs that contained queries. --- diff --git a/includes/libs/CSSMin.php b/includes/libs/CSSMin.php index 65268e1dc6..5cd5a7d08c 100644 --- a/includes/libs/CSSMin.php +++ b/includes/libs/CSSMin.php @@ -36,7 +36,7 @@ class CSSMin { * which when base64 encoded will result in a 1/3 increase in size. */ const EMBED_SIZE_LIMIT = 24576; - const URL_REGEX = 'url\(\s*[\'"]?(?P[^\?\)\'"]*)\??[^\)\'"]*[\'"]?\s*\)'; + const URL_REGEX = 'url\(\s*[\'"]?(?P[^\?\)\'"]*)(?P\??[^\)\'"]*)[\'"]?\s*\)'; /* Protected Static Members */ @@ -130,6 +130,7 @@ class CSSMin { $embed = $match['embed'][0]; $pre = $match['pre'][0]; $post = $match['post'][0]; + $query = $match['query'][0]; $url = "{$remote}/{$match['file'][0]}"; $file = "{$local}/{$match['file'][0]}"; $replacement = false; @@ -163,7 +164,7 @@ class CSSMin { } } else if ( $local === false ) { // Assume that all paths are relative to $remote, and make them absolute - $replacement = "{$embed}{$pre}url({$url}){$post};"; + $replacement = "{$embed}{$pre}url({$url}{$query}){$post};"; } if ( $replacement !== false ) { // Perform replacement on the source