r109643 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r109642‎ | r109643 | r109644 >
Date:20:52, 20 January 2012
Author:aaron
Status:ok
Tags:core 
Comment:
Similar to r108937: fixed breakage where the zone urls were defined as relative paths.
Modified paths:
  • /trunk/phase3/thumb.php (modified) (history)

Diff [purge]

Index: trunk/phase3/thumb.php
@@ -227,11 +227,16 @@
228228 function wfExtractThumbParams( $uri ) {
229229 $repo = RepoGroup::singleton()->getLocalRepo();
230230
231 - $bits = wfParseUrl( $repo->getZoneUrl( 'thumb' ) );
232 - if ( !$bits ) {
233 - return null;
 231+ $zoneURI = $repo->getZoneUrl( 'thumb' );
 232+ if ( substr( $zoneURI, 0, 1 ) !== '/' ) {
 233+ $bits = wfParseUrl( $zoneURI );
 234+ if ( $bits && isset( $bits['path'] ) ) {
 235+ $zoneURI = $bits['path'];
 236+ } else {
 237+ return null;
 238+ }
234239 }
235 - $zoneUrlRegex = preg_quote( $bits['path'] );
 240+ $zoneUrlRegex = preg_quote( $zoneURI );
236241
237242 $hashDirRegex = $subdirRegex = '';
238243 for ( $i = 0; $i < $repo->getHashLevels(); $i++ ) {

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r108937r105512: Handle REDIRECT_URL discrepancies and always work with URI paths for...aaron19:17, 14 January 2012

Status & tagging log