From 797544d3a3d941b95c7954e9333db36727dc2c69 Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Mon, 14 Mar 2011 15:01:50 +0000 Subject: [PATCH] (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 --- includes/libs/CSSMin.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/includes/libs/CSSMin.php b/includes/libs/CSSMin.php index faea5517d6..d5a3a2df7a 100644 --- a/includes/libs/CSSMin.php +++ b/includes/libs/CSSMin.php @@ -144,6 +144,9 @@ class CSSMin { $query = $match['query'][0]; $url = "{$remote}/{$match['file'][0]}"; $file = "{$local}/{$match['file'][0]}"; + // bug 27052 - Guard against double slashes, because foo//../bar + // apparently resolves to foo/bar on (some?) clients + $url = preg_replace( '#//+#', '/', $url ); $replacement = false; if ( $local !== false && file_exists( $file ) ) { // Add version parameter as a time-stamp in ISO 8601 format, -- 2.20.1