X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/mediawiki.git/blobdiff_plain/8989532d3de45b196373107c7a812a68ac0ff2d9..d75ce11339b35963b5f8c3d53190819c1c025716:/includes/ImageFunctions.php diff --git a/includes/ImageFunctions.php b/includes/ImageFunctions.php index 73d935a7..5f01ab6e 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 ) ) ) {