r82156 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r82155‎ | r82156 | r82157 >
Date:00:49, 15 February 2011
Author:tparscal
Status:ok
Tags:
Comment:
Resolves remaining issues in r82000 with remapping relative CSS URLs that contained queries.
Modified paths:
  • /trunk/phase3/includes/libs/CSSMin.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/libs/CSSMin.php
@@ -36,7 +36,7 @@
3737 * which when base64 encoded will result in a 1/3 increase in size.
3838 */
3939 const EMBED_SIZE_LIMIT = 24576;
40 - const URL_REGEX = 'url\(\s*[\'"]?(?P<file>[^\?\)\'"]*)\??[^\)\'"]*[\'"]?\s*\)';
 40+ const URL_REGEX = 'url\(\s*[\'"]?(?P<file>[^\?\)\'"]*)(?P<query>\??[^\)\'"]*)[\'"]?\s*\)';
4141
4242 /* Protected Static Members */
4343
@@ -130,6 +130,7 @@
131131 $embed = $match['embed'][0];
132132 $pre = $match['pre'][0];
133133 $post = $match['post'][0];
 134+ $query = $match['query'][0];
134135 $url = "{$remote}/{$match['file'][0]}";
135136 $file = "{$local}/{$match['file'][0]}";
136137 $replacement = false;
@@ -163,7 +164,7 @@
164165 }
165166 } else if ( $local === false ) {
166167 // Assume that all paths are relative to $remote, and make them absolute
167 - $replacement = "{$embed}{$pre}url({$url}){$post};";
 168+ $replacement = "{$embed}{$pre}url({$url}{$query}){$post};";
168169 }
169170 if ( $replacement !== false ) {
170171 // Perform replacement on the source

Follow-up revisions

RevisionCommit summaryAuthorDate
r82218Followup r82156: skip relative URLs with absolute paths toocatrope06:27, 16 February 2011
r822201.17wmf1: MFT r80495, r80765, r81177, r82000, r82155, r82156, r82191, r82200,...catrope07:23, 16 February 2011
r85151MFT: r82000, r82004, r82020, r82025, r82038, r82039, r82048, r82070, r82081, ...demon20:39, 1 April 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r82000Resolves bug #27328 by supporting URL rewriting for CSS that comes from the W...tparscal22:57, 11 February 2011

Status & tagging log