From 8f0814e64c0ae27bda0dc7e0d862fb95f2222d18 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Fri, 20 Jan 2012 20:52:09 +0000 Subject: [PATCH] Similar to r108937: fixed breakage where the zone urls were defined as relative paths. --- thumb.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/thumb.php b/thumb.php index 7317a6dacc..e5fcf3a8b5 100644 --- 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++ ) { -- 2.20.1