From 35c61744a640c795f4a163178e01da90df7d515d Mon Sep 17 00:00:00 2001 From: Brian Wolff Date: Wed, 20 Apr 2011 19:43:47 +0000 Subject: [PATCH] (bug 23816) Add tracking category for any page with a broken image. Note this considers a link to a non-existent image to be broken. A link to an image that exists but does not have a handler is not considered broken. --- RELEASE-NOTES | 1 + includes/parser/Parser.php | 4 ++++ languages/messages/MessagesEn.php | 1 + languages/messages/MessagesQqq.php | 1 + maintenance/language/messages.inc | 1 + 5 files changed, 8 insertions(+) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 400ad59522..02d66f41b4 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -133,6 +133,7 @@ PHP if you have not done so prior to upgrading MediaWiki. * Special:ListFiles is now transcludable. * (bug 13879) Special:Emailuser asks for suitable target user if called without. * (bug 16956) IPTC and XMP metadata now extracted from images +* (bug 23816) A tracking category is now added for any pages with broken images. === Bug fixes in 1.18 === * (bug 23119) WikiError class and subclasses are now marked as deprecated diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index 92cff97059..c3f6a39bbe 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -4810,6 +4810,10 @@ class Parser { list( $paramMap, $mwArray ) = $this->getImageParams( $handler ); + if ( !$file ) { + $this->addTrackingCategory( 'broken-file-category' ); + } + # Process the input parameters $caption = ''; $params = array( 'frame' => array(), 'handler' => array(), diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 63fa8043e9..fa49b1bf20 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -749,6 +749,7 @@ XHTML id names. 'listingcontinuesabbrev' => 'cont.', 'index-category' => 'Indexed pages', 'noindex-category' => 'Noindexed pages', +'broken-file-category' => 'Pages with broken file links', 'linkprefix' => '/^(.*?)([a-zA-Z\\x80-\\xff]+)$/sD', # only translate this message to other languages if you have to change it 'mainpagetext' => "'''MediaWiki has been successfully installed.'''", diff --git a/languages/messages/MessagesQqq.php b/languages/messages/MessagesQqq.php index a50b9bdf85..c74d0a11a7 100644 --- a/languages/messages/MessagesQqq.php +++ b/languages/messages/MessagesQqq.php @@ -260,6 +260,7 @@ This is the toolbar: [[Image:Toolbar.png]]", See http://test.wikipedia.org/wiki/Category:Test_ko?uselang={{SUBPAGENAME}}, for example.', 'index-category' => 'Name of the category where pages with the __INDEX__ behaviour switch are listed. For description of this behaviour switch see [http://www.mediawiki.org/wiki/Help:Magic_words#Behavior_switches mediawiki].', 'noindex-category' => 'Name of the category where pages with the __NOINDEX__ behaviour switch are listed. For description of this behaviour switch see [http://www.mediawiki.org/wiki/Help:Magic_words#Behavior_switches mediawiki].', +'broken-file-category' => 'Name of category where pages that embed files that do not exist ("broken images") are listed.', 'linkprefix' => '{{optional}}', 'mainpagetext' => 'Along with {{msg|mainpagedocfooter}}, the text you will see on the Main Page when your wiki is installed.', diff --git a/maintenance/language/messages.inc b/maintenance/language/messages.inc index 1f7dc63cf4..abdd76cde1 100644 --- a/maintenance/language/messages.inc +++ b/maintenance/language/messages.inc @@ -157,6 +157,7 @@ $wgMessageStructure = array( 'listingcontinuesabbrev', 'index-category', 'noindex-category', + 'broken-file-category', ), 'mainpage' => array( 'linkprefix', -- 2.20.1