From e9e0bf8cc11d0ae4297c68d37ccaafb48d4c0ef8 Mon Sep 17 00:00:00 2001 From: Bryan Tong Minh Date: Sat, 9 Jul 2011 10:31:09 +0000 Subject: [PATCH] Follow-up r88054: register the file if a hook changed the target file. --- includes/parser/Parser.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index 6227ac3cfe..6cf9bbc076 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -3554,6 +3554,12 @@ class Parser { if ( $file && !$title->equals( $file->getTitle() ) ) { # Update fetched file title $title = $file->getTitle(); + if ( is_null( $file->getRedirectedTitle() ) ) { + # This file was not a redirect, but the title does not match. + # Register under the new name because otherwise the link will + # get lost. + $this->mOutput->addImage( $title->getDBkey(), $time, $sha1 ); + } } return array( $file, $title ); } -- 2.20.1