r83902 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r83901‎ | r83902 | r83903 >
Date:15:01, 14 March 2011
Author:catrope
Status:resolved (Comments)
Tags:
Comment:
(bug 27052) CSSMin generated URLs like foo//../bar in some cases, which apparently resolves to foo/bar rather than foo/../bar or bar . Fixed by eliminating duplicate slashes from the file URL when remapping
Modified paths:
  • /trunk/phase3/includes/libs/CSSMin.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/libs/CSSMin.php
@@ -144,6 +144,9 @@
145145 $query = $match['query'][0];
146146 $url = "{$remote}/{$match['file'][0]}";
147147 $file = "{$local}/{$match['file'][0]}";
 148+ // bug 27052 - Guard against double slashes, because foo//../bar
 149+ // apparently resolves to foo/bar on (some?) clients
 150+ $url = preg_replace( '#//+#', '/', $url );
148151 $replacement = false;
149152 if ( $local !== false && file_exists( $file ) ) {
150153 // Add version parameter as a time-stamp in ISO 8601 format,

Follow-up revisions

RevisionCommit summaryAuthorDate
r83988keep double slash filter from breaking absolute URLs, fix to r83902kaldari01:57, 15 March 2011
r83989oops, don't delete char before the slash, followup to r83902kaldari02:03, 15 March 2011
r846131.17wmf1: MFT r81692, r82468, r83814, r83885, r83891, r83897, r83902, r83903,...catrope17:42, 23 March 2011
r85434MFT: r83885, r83891, r83897, r83902, r83903, r83934, r83965, r83979, r83988, ...demon13:38, 5 April 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r81223SVGEdit extension: work around bug 27052 by moving ajax-loader.gif under modu...brion22:36, 30 January 2011
r81228SVGEdit extension UI prettification, fixes....brion03:46, 31 January 2011

Comments

#Comment by Mdale (talk | contribs)   01:53, 15 March 2011

this breaks things, since the check is run against the entire url you get http://foo.com -> http:/foo.com .. please fix the regex to not replace :// at the start of the url

#Comment by Catrope (talk | contribs)   17:27, 15 March 2011

D'oh! Kaldari fixed it in r83988 and r83989.

Status & tagging log