From a77e0f4231f0e3668ced5121c0627f162a9fe1bd Mon Sep 17 00:00:00 2001 From: =?utf8?q?Niklas=20Laxstr=C3=B6m?= Date: Mon, 27 Nov 2006 22:55:12 +0000 Subject: [PATCH] * Indentation, magic numbers --- includes/Namespace.php | 4 ++-- includes/Title.php | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/includes/Namespace.php b/includes/Namespace.php index 73dc296930..78493902f2 100644 --- a/includes/Namespace.php +++ b/includes/Namespace.php @@ -11,7 +11,7 @@ $wgCanonicalNamespaceNames = array( NS_MEDIA => 'Media', NS_SPECIAL => 'Special', - NS_TALK => 'Talk', + NS_TALK => 'Talk', NS_USER => 'User', NS_USER_TALK => 'User_talk', NS_PROJECT => 'Project', @@ -24,7 +24,7 @@ $wgCanonicalNamespaceNames = array( NS_TEMPLATE_TALK => 'Template_talk', NS_HELP => 'Help', NS_HELP_TALK => 'Help_talk', - NS_CATEGORY => 'Category', + NS_CATEGORY => 'Category', NS_CATEGORY_TALK => 'Category_talk', ); diff --git a/includes/Title.php b/includes/Title.php index 3bcc06449d..f2b8d10c62 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -984,7 +984,7 @@ class Title { */ function isProtected( $action = '' ) { global $wgRestrictionLevels; - if ( -1 == $this->mNamespace ) { return true; } + if ( NS_SPECIAL == $this->mNamespace ) { return true; } if( $action == 'edit' || $action == '' ) { $r = $this->getRestrictions( 'edit' ); @@ -1016,7 +1016,7 @@ class Title { global $wgUser; if ( is_null( $this->mWatched ) ) { - if ( -1 == $this->mNamespace || 0 == $wgUser->getID()) { + if ( NS_SPECIAL == $this->mNamespace || !$wgUser->isLoggedIn()) { $this->mWatched = false; } else { $this->mWatched = $wgUser->isWatched( $this ); @@ -1517,7 +1517,7 @@ class Title { # We already know that some pages won't be in the database! # - if ( '' != $this->mInterwiki || -1 == $this->mNamespace ) { + if ( '' != $this->mInterwiki || NS_SPECIAL == $this->mNamespace ) { $this->mArticleID = 0; } $f = strstr( $r, '#' ); -- 2.20.1