* Fixed a bug where the watchlist count without talk pages would be off by a
[lhc/web/wiklou.git] / includes / Title.php
index e84c236..f8d5f0b 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;
        }
 
@@ -1623,7 +1627,7 @@ class Title {
                
                # Save a null revision in the page's history notifying of the move
                $nullRevision = Revision::newNullRevision( $dbw, $oldid,
-                       wfMsg( '1movedto2', $this->getPrefixedText(), $nt->getPrefixedText() ),
+                       wfMsgForContent( '1movedto2', $this->getPrefixedText(), $nt->getPrefixedText() ),
                        true );
                $nullRevId = $nullRevision->insertOn( $dbw );
                
@@ -1698,7 +1702,7 @@ class Title {
 
                # Save a null revision in the page's history notifying of the move
                $nullRevision = Revision::newNullRevision( $dbw, $oldid,
-                       wfMsg( '1movedto2', $this->getPrefixedText(), $nt->getPrefixedText() ),
+                       wfMsgForContent( '1movedto2', $this->getPrefixedText(), $nt->getPrefixedText() ),
                        true );
                $nullRevId = $nullRevision->insertOn( $dbw );
                
@@ -1987,10 +1991,9 @@ class Title {
         * this category. Special pages never exist in the database. Some images do not
         * have description pages in the database, but the description page contains 
         * useful history information that the user may want to link to.
-        * 
         */
        function isAlwaysKnown() {
-               return $this->isExternal() || ( 0 == $this->mNamespace && "" == $this->mDbkeyform ) 
+               return  $this->isExternal() || ( 0 == $this->mNamespace && "" == $this->mDbkeyform ) 
                  || NS_SPECIAL == $this->mNamespace || NS_IMAGE == $this->mNamespace;
        }