From: Bryan Tong Minh Date: Sat, 9 Jul 2011 10:31:09 +0000 (+0000) Subject: Follow-up r88054: register the file if a hook changed the target file. X-Git-Tag: 1.31.0-rc.0~28963 X-Git-Url: http://git.cyclocoop.org/%7D%7Cconcat%7B?a=commitdiff_plain;h=e9e0bf8cc11d0ae4297c68d37ccaafb48d4c0ef8;p=lhc%2Fweb%2Fwiklou.git Follow-up r88054: register the file if a hook changed the target file. --- 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 ); }