From: Amir E. Aharoni Date: Fri, 2 May 2014 11:31:09 +0000 (+0200) Subject: Check for the namespace correctly in Special:Allmessages X-Git-Tag: 1.31.0-rc.0~15906^2 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dmes_infos.php?a=commitdiff_plain;h=5b67f0effadfb70a2d121c83323db134866ab6ef;p=lhc%2Fweb%2Fwiklou.git Check for the namespace correctly in Special:Allmessages This is a followup to I21a6d4359faf9d86ce3b01e423e8c3ab4c02658f It fixes an error there, which causes a lot of messages not to appear. This checks for the namespace of the page correctly. Change-Id: I63a34a4d674454edf9627a5893ef9dd15643f927 --- diff --git a/includes/specials/SpecialAllmessages.php b/includes/specials/SpecialAllmessages.php index 33c92b5e0a..687cbd0a27 100644 --- a/includes/specials/SpecialAllmessages.php +++ b/includes/specials/SpecialAllmessages.php @@ -272,19 +272,23 @@ class AllmessagesTablePager extends TablePager { foreach ( $res as $s ) { $exists = false; + if ( $foreign ) { - $title = explode( '/', $s->page_title ); - if ( count( $title ) === 2 && $langcode === $title[1] - && isset( $xNames[$title[0]] ) + $titleParts = explode( '/', $s->page_title ); + if ( count( $titleParts ) === 2 && + $langcode === $titleParts[1] && + isset( $xNames[$titleParts[0]] ) ) { - $exists = $title[0]; + $exists = $titleParts[0]; } } elseif ( isset( $xNames[$s->page_title] ) ) { $exists = $s->page_title; } - if ( $exists && $s->page_namespace === NS_MEDIAWIKI ) { + + $title = Title::newFromRow( $s ); + if ( $exists && $title->inNamespace( NS_MEDIAWIKI ) ) { $pageFlags[$exists] = true; - } elseif ( $exists && $s->page_namespace === NS_MEDIAWIKI_TALK ) { + } elseif ( $exists && $title->inNamespace( NS_MEDIAWIKI_TALK ) ) { $talkFlags[$exists] = true; } }