bug 20519 Redirects in the stable version showed up wrong
authorAaron Schulz <aaron@users.mediawiki.org>
Sun, 6 Sep 2009 10:09:45 +0000 (10:09 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Sun, 6 Sep 2009 10:09:45 +0000 (10:09 +0000)
includes/Wiki.php

index 8c391e6..6ecbc39 100644 (file)
@@ -310,8 +310,9 @@ class MediaWiki {
                        wfRunHooks( 'InitializeArticleMaybeRedirect', 
                                array(&$title,&$request,&$ignoreRedirect,&$target,&$article) );
 
-                       // Follow redirects only for... redirects
-                       if( !$ignoreRedirect && $article->isRedirect() ) {
+                       // Follow redirects only for... redirects.
+                       // If $target is set, then a hook wanted to redirect.
+                       if( !$ignoreRedirect && ($target || $article->isRedirect()) ) {
                                # Is the target already set by an extension?
                                $target = $target ? $target : $article->followRedirect();
                                if( is_string( $target ) ) {