Similar to r108937: fixed breakage where the zone urls were defined as relative paths.
authorAaron Schulz <aaron@users.mediawiki.org>
Fri, 20 Jan 2012 20:52:09 +0000 (20:52 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Fri, 20 Jan 2012 20:52:09 +0000 (20:52 +0000)
thumb.php

index 7317a6d..e5fcf3a 100644 (file)
--- a/thumb.php
+++ b/thumb.php
@@ -227,11 +227,16 @@ function wfStreamThumb( array $params ) {
 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++ ) {