s/0/NS_MAIN/
authorAntoine Musso <hashar@users.mediawiki.org>
Fri, 28 Jan 2005 05:10:05 +0000 (05:10 +0000)
committerAntoine Musso <hashar@users.mediawiki.org>
Fri, 28 Jan 2005 05:10:05 +0000 (05:10 +0000)
includes/Article.php
includes/SearchEngine.php
includes/SpecialUncategorizedpages.php
includes/Title.php

index 48d0b85..293a6d0 100644 (file)
@@ -444,11 +444,13 @@ class Article {
        /**
         * Would the given text make this article a "good" article (i.e.,
         * suitable for including in the article count)?
+        * @param string $text Text to analyze
+        * @return integer 1 if it can be counted else 0
         */
        function isCountable( $text ) {
                global $wgUseCommaCount;
 
-               if ( 0 != $this->mTitle->getNamespace() ) { return 0; }
+               if ( NS_MAIN != $this->mTitle->getNamespace() ) { return 0; }
                if ( $this->isRedirect( $text ) ) { return 0; }
                $token = ($wgUseCommaCount ? ',' : '[[' );
                if ( false === strstr( $text, $token ) ) { return 0; }
index 90e2671..2e83974 100644 (file)
@@ -120,7 +120,7 @@ class SearchEngine {
                global $wgContLang;
                $arr = array();
                foreach( $wgContLang->getNamespaces() as $ns => $name ) {
-                       if( $ns >= 0 ) {
+                       if( $ns >= NS_MAIN ) {
                                $arr[$ns] = $name;
                        }
                }
index d35a889..4487c3c 100755 (executable)
@@ -16,7 +16,7 @@ require_once( "QueryPage.php" );
  * @subpackage SpecialPage
  */
 class UncategorizedPagesPage extends PageQueryPage {
-       var $requestedNamespace = 0;
+       var $requestedNamespace = NS_MAIN;
        
        function getName() {
                return "Uncategorizedpages";
index cfb5f49..b42254e 100644 (file)
@@ -59,7 +59,7 @@ class Title {
                $this->mInterwiki = $this->mUrlform =
                $this->mTextform = $this->mDbkeyform = '';
                $this->mArticleID = -1;
-               $this->mNamespace = 0;
+               $this->mNamespace = NS_MAIN;
                $this->mRestrictionsLoaded = false;
                $this->mRestrictions = array();
                # Dont change the following, NS_MAIN is hardcoded in several place
@@ -98,7 +98,7 @@ class Title {
         * @static
         * @access public
         */
-       /* static */ function &newFromText( $text, $defaultNamespace = 0 ) {    
+       function &newFromText( $text, $defaultNamespace = NS_MAIN ) {   
                $fname = 'Title::newFromText';
                wfProfileIn( $fname );
                
@@ -111,7 +111,7 @@ class Title {
                 * In theory these are value objects and won't get changed...
                 */
                static $titleCache = array();
-               if( $defaultNamespace == 0 && isset( $titleCache[$text] ) ) {
+               if( $defaultNamespace == NS_MAIN && isset( $titleCache[$text] ) ) {
                        wfProfileOut( $fname );
                        return $titleCache[$text];
                }
@@ -136,7 +136,7 @@ class Title {
                $t->mDefaultNamespace = $defaultNamespace;
 
                if( $t->secureAndSplit() ) {
-                       if( $defaultNamespace == 0 ) {
+                       if( $defaultNamespace == NS_MAIN ) {
                                if( count( $titleCache ) >= MW_TITLECACHE_MAX ) {
                                        # Avoid memory leaks on mass operations...
                                        $titleCache = array();