r82457 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r82456‎ | r82457 | r82458 >
Date:14:58, 19 February 2011
Author:catrope
Status:ok
Tags:
Comment:
(bug 27328) Redo r82218 properly, expanding URLs with absolute paths
Modified paths:
  • /trunk/phase3/includes/libs/CSSMin.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/libs/CSSMin.php
@@ -126,6 +126,17 @@
127127 $offset = $match[0][1] + strlen( $match[0][0] );
128128 continue;
129129 }
 130+ // URLs with absolute paths like /w/index.php need to be expanded
 131+ // to absolute URLs but otherwise left alone
 132+ if ( $match['file'][0] !== '' && $match['file'][0][0] === '/' ) {
 133+ // Replace the file path with an expanded URL
 134+ $source = substr_replace( $source, wfExpandUrl( $match['file'][0] ),
 135+ $match['file'][1], strlen( $match['file'][0] )
 136+ );
 137+ // Move the offset to the end of the match, leaving it alone
 138+ $offset = $match[0][1] + strlen( $match[0][0] );
 139+ continue;
 140+ }
130141 // Shortcuts
131142 $embed = $match['embed'][0];
132143 $pre = $match['pre'][0];

Follow-up revisions

RevisionCommit summaryAuthorDate
r825331.17wmf1: MFT r78893, r78897, r78909, r82404, r82408, r82409, r82453, r82456,...catrope20:13, 20 February 2011
r85211MFT: r82297, r82307, r82309, r82312, r82315, r82337, r82391, r82392, r82403, ...demon21:01, 2 April 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r82218Followup r82156: skip relative URLs with absolute paths toocatrope06:27, 16 February 2011

Status & tagging log