* Indentation, magic numbers
authorNiklas Laxström <nikerabbit@users.mediawiki.org>
Mon, 27 Nov 2006 22:55:12 +0000 (22:55 +0000)
committerNiklas Laxström <nikerabbit@users.mediawiki.org>
Mon, 27 Nov 2006 22:55:12 +0000 (22:55 +0000)
includes/Namespace.php
includes/Title.php

index 73dc296..7849390 100644 (file)
@@ -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',
 );
 
index 3bcc064..f2b8d10 100644 (file)
@@ -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, '#' );