Fomafix has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/351018 )

Change subject: Use isSpecialPage() where possible
......................................................................

Use isSpecialPage() where possible

Change-Id: Ie4d0838acf96a7ed4a1fe4cfdc901c77d3312174
---
M includes/MediaWiki.php
M includes/Title.php
M includes/parser/ParserOutput.php
3 files changed, 4 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/18/351018/1

diff --git a/includes/MediaWiki.php b/includes/MediaWiki.php
index 0fd6b92..b18414d 100644
--- a/includes/MediaWiki.php
+++ b/includes/MediaWiki.php
@@ -282,7 +282,7 @@
                        }
 
                        // Special pages ($title may have changed since if 
statement above)
-                       if ( NS_SPECIAL == $title->getNamespace() ) {
+                       if ( $title->isSpecialPage() ) {
                                // Actions that need to be made when we have a 
special pages
                                SpecialPageFactory::executePath( $title, 
$this->context );
                        } else {
diff --git a/includes/Title.php b/includes/Title.php
index dd6aaef..e460cda 100644
--- a/includes/Title.php
+++ b/includes/Title.php
@@ -2123,7 +2123,7 @@
        private function checkSpecialsAndNSPermissions( $action, $user, 
$errors, $rigor, $short ) {
                # Only 'createaccount' can be performed on special pages,
                # which don't actually exist in the DB.
-               if ( NS_SPECIAL == $this->mNamespace && $action !== 
'createaccount' ) {
+               if ( $this->isSpecialPage() && $action !== 'createaccount' ) {
                        $errors[] = [ 'ns-specialprotected' ];
                }
 
@@ -3426,7 +3426,7 @@
                $this->mTextform = strtr( $this->mDbkeyform, '_', ' ' );
 
                # We already know that some pages won't be in the database!
-               if ( $this->isExternal() || $this->mNamespace == NS_SPECIAL ) {
+               if ( $this->isExternal() || $this->isSpecialPage() ) {
                        $this->mArticleID = 0;
                }
 
diff --git a/includes/parser/ParserOutput.php b/includes/parser/ParserOutput.php
index 7de3b30..10ac192 100644
--- a/includes/parser/ParserOutput.php
+++ b/includes/parser/ParserOutput.php
@@ -708,7 +708,7 @@
         * @since 1.25
         */
        public function addTrackingCategory( $msg, $title ) {
-               if ( $title->getNamespace() === NS_SPECIAL ) {
+               if ( $title->isSpecialPage() ) {
                        wfDebug( __METHOD__ . ": Not adding tracking category 
$msg to special page!\n" );
                        return false;
                }

-- 
To view, visit https://gerrit.wikimedia.org/r/351018
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie4d0838acf96a7ed4a1fe4cfdc901c77d3312174
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Fomafix <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to