don't use the database to check if special pages were deleted
authorTim Starling <tstarling@users.mediawiki.org>
Sat, 25 Jun 2005 13:40:38 +0000 (13:40 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Sat, 25 Jun 2005 13:40:38 +0000 (13:40 +0000)
includes/Title.php

index e84c236..9348d34 100644 (file)
@@ -1072,9 +1072,13 @@ class Title {
         */
        function isDeleted() {
                $fname = 'Title::isDeleted';
-               $dbr =& wfGetDB( DB_SLAVE );
-               $n = $dbr->selectField( 'archive', 'COUNT(*)', array( 'ar_namespace' => $this->getNamespace(), 
-                       'ar_title' => $this->getDBkey() ), $fname );
+               if ( $this->getNamespace() < 0 ) {
+                       $n = 0;
+               } else {
+                       $dbr =& wfGetDB( DB_SLAVE );
+                       $n = $dbr->selectField( 'archive', 'COUNT(*)', array( 'ar_namespace' => $this->getNamespace(), 
+                               'ar_title' => $this->getDBkey() ), $fname );
+               }
                return (int)$n;
        }