summaryrefslogtreecommitdiff
path: root/includes/ImageFunctions.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/ImageFunctions.php')
-rw-r--r--includes/ImageFunctions.php6
1 files changed, 6 insertions, 0 deletions
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 ) ) ) {