https://www.mediawiki.org/wiki/Special:Code/MediaWiki/109643

Revision: 109643
Author:   aaron
Date:     2012-01-20 20:52:09 +0000 (Fri, 20 Jan 2012)
Log Message:
-----------
Similar to r108937: fixed breakage where the zone urls were defined as relative 
paths.

Modified Paths:
--------------
    trunk/phase3/thumb.php

Modified: trunk/phase3/thumb.php
===================================================================
--- trunk/phase3/thumb.php      2012-01-20 20:41:42 UTC (rev 109642)
+++ trunk/phase3/thumb.php      2012-01-20 20:52:09 UTC (rev 109643)
@@ -227,11 +227,16 @@
 function wfExtractThumbParams( $uri ) {
        $repo = RepoGroup::singleton()->getLocalRepo();
 
-       $bits = wfParseUrl( $repo->getZoneUrl( 'thumb' ) );
-       if ( !$bits ) {
-               return null;
+       $zoneURI = $repo->getZoneUrl( 'thumb' );
+       if ( substr( $zoneURI, 0, 1 ) !== '/' ) {
+               $bits = wfParseUrl( $zoneURI );
+               if ( $bits && isset( $bits['path'] ) ) {
+                       $zoneURI = $bits['path'];
+               } else {
+                       return null;
+               }
        }
-       $zoneUrlRegex = preg_quote( $bits['path'] );
+       $zoneUrlRegex = preg_quote( $zoneURI );
 
        $hashDirRegex = $subdirRegex = '';
        for ( $i = 0; $i < $repo->getHashLevels(); $i++ ) {


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to