From 05211a190b90b17357830646ad0e1894e137a76f Mon Sep 17 00:00:00 2001 From: Victor Vasiliev Date: Fri, 1 May 2009 21:22:25 +0000 Subject: [PATCH] * (bug 15008) Redirect images are now subject to Bad image list rules --- RELEASE-NOTES | 1 + includes/ImageFunctions.php | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index c9ffcfae67..06a226875c 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 == diff --git a/includes/ImageFunctions.php b/includes/ImageFunctions.php index 73d935a786..5f01ab6ef8 100644 --- a/includes/ImageFunctions.php +++ b/includes/ImageFunctions.php @@ -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 ) ) ) { -- 2.20.1