* (bug 15008) Redirect images are now subject to Bad image list rules
authorVictor Vasiliev <vasilievvv@users.mediawiki.org>
Fri, 1 May 2009 21:22:25 +0000 (21:22 +0000)
committerVictor Vasiliev <vasilievvv@users.mediawiki.org>
Fri, 1 May 2009 21:22:25 +0000 (21:22 +0000)
RELEASE-NOTES
includes/ImageFunctions.php

index c9ffcfa..06a2268 100644 (file)
@@ -108,6 +108,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 18207) Strange spacing before [[irc:...]] links
 * Removed float from the user login form in RTL interface - caused display
   problems in FF2
+* (bug 15008) Redirect images are now subject to Bad image list rules
 
 == API changes in 1.16 ==
 
index 73d935a..5f01ab6 100644 (file)
@@ -123,6 +123,12 @@ function wfIsBadImage( $name, $contextTitle = false ) {
        static $badImages = false;
        wfProfileIn( __METHOD__ );
 
+       # Handle redirects
+       $redirectTitle = RepoGroup::singleton()->checkRedirect( Title::makeTitle( NS_FILE, $name ) );
+       if( $redirectTitle ) {
+               $name = $redirectTitle->getDbKey();
+       }
+
        # Run the extension hook
        $bad = false;
        if( !wfRunHooks( 'BadImage', array( $name, &$bad ) ) ) {