From 97a945864ad217c4c0b1e938ded42309aaa0bdee Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Sat, 19 Feb 2011 14:58:16 +0000 Subject: [PATCH] (bug 27328) Redo r82218 properly, expanding URLs with absolute paths --- includes/libs/CSSMin.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/includes/libs/CSSMin.php b/includes/libs/CSSMin.php index 5cd5a7d08c..faea5517d6 100644 --- a/includes/libs/CSSMin.php +++ b/includes/libs/CSSMin.php @@ -126,6 +126,17 @@ class CSSMin { $offset = $match[0][1] + strlen( $match[0][0] ); continue; } + // URLs with absolute paths like /w/index.php need to be expanded + // to absolute URLs but otherwise left alone + if ( $match['file'][0] !== '' && $match['file'][0][0] === '/' ) { + // Replace the file path with an expanded URL + $source = substr_replace( $source, wfExpandUrl( $match['file'][0] ), + $match['file'][1], strlen( $match['file'][0] ) + ); + // Move the offset to the end of the match, leaving it alone + $offset = $match[0][1] + strlen( $match[0][0] ); + continue; + } // Shortcuts $embed = $match['embed'][0]; $pre = $match['pre'][0]; -- 2.20.1