thumb_handler.php doesn't seem to extract path_info correctly
authorBrian Wolff <bawolff+wn@gmail.com>
Mon, 17 Jun 2013 01:43:13 +0000 (22:43 -0300)
committerBrian Wolff <bawolff+wn@gmail.com>
Mon, 17 Jun 2013 01:43:13 +0000 (22:43 -0300)
Set $wgArticlePath so that it works the way that [[Manual:Thumb.php]]
claims it does.

Change-Id: I35b4ab73e1d84dad10503d3a098ee154e8d58d8a

thumb.php

index 4a0c9fb..b9826a7 100644 (file)
--- 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;