From 377f8ffa07cd78a9fe25f3746fccba21b40c3148 Mon Sep 17 00:00:00 2001 From: Brian Wolff Date: Sun, 16 Jun 2013 22:43:13 -0300 Subject: [PATCH] thumb_handler.php doesn't seem to extract path_info correctly Set $wgArticlePath so that it works the way that [[Manual:Thumb.php]] claims it does. Change-Id: I35b4ab73e1d84dad10503d3a098ee154e8d58d8a --- thumb.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/thumb.php b/thumb.php index 4a0c9fb3d39..b9826a78878 100644 --- a/thumb.php +++ b/thumb.php @@ -62,9 +62,15 @@ function wfThumbHandle404() { # Set action base paths so that WebRequest::getPathInfo() # recognizes the "X" as the 'title' in ../thumb_handler.php/X urls. - $wgArticlePath = false; # Don't let a "/*" article path clober our action path + # Note: If Custom per-extension repo paths are set, this may break. + $repo = RepoGroup::singleton()->getLocalRepo(); + $oldArticlePath = $wgArticlePath; + $wgArticlePath = $repo->getZoneUrl( 'thumb' ) . '/$1'; $matches = WebRequest::getPathInfo(); + + $wgArticlePath = $oldArticlePath; + if ( !isset( $matches['title'] ) ) { wfThumbError( 404, 'Could not determine the name of the requested thumbnail.' ); return; -- 2.11.4.GIT