From: Roan Kattouw Date: Sat, 19 Feb 2011 14:58:16 +0000 (+0000) Subject: (bug 27328) Redo r82218 properly, expanding URLs with absolute paths X-Git-Tag: 1.31.0-rc.0~31895 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=97a945864ad217c4c0b1e938ded42309aaa0bdee;p=lhc%2Fweb%2Fwiklou.git (bug 27328) Redo r82218 properly, expanding URLs with absolute paths --- 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];