Index: trunk/phase3/includes/WikiPage.php |
— | — | @@ -404,7 +404,7 @@ |
405 | 405 | * @return bool Whether or not the page exists in the database |
406 | 406 | */ |
407 | 407 | public function exists() { |
408 | | - return $this->getId() > 0; |
| 408 | + return $this->mTitle->exists(); |
409 | 409 | } |
410 | 410 | |
411 | 411 | /** |
— | — | @@ -416,7 +416,7 @@ |
417 | 417 | * @return bool |
418 | 418 | */ |
419 | 419 | public function hasViewableContent() { |
420 | | - return $this->exists() || $this->mTitle->isAlwaysKnown(); |
| 420 | + return $this->mTitle->exists() || $this->mTitle->isAlwaysKnown(); |
421 | 421 | } |
422 | 422 | |
423 | 423 | /** |
— | — | @@ -717,7 +717,7 @@ |
718 | 718 | |
719 | 719 | return $wgEnableParserCache |
720 | 720 | && $parserOptions->getStubThreshold() == 0 |
721 | | - && $this->exists() |
| 721 | + && $this->mTitle->exists() |
722 | 722 | && ( $oldid === null || $oldid === 0 || $oldid === $this->getLatest() ) |
723 | 723 | && $this->mTitle->isWikitextPage(); |
724 | 724 | } |
— | — | @@ -786,10 +786,10 @@ |
787 | 787 | } |
788 | 788 | |
789 | 789 | if ( $this->mTitle->getNamespace() == NS_MEDIAWIKI ) { |
790 | | - if ( $this->getId() == 0 ) { |
| 790 | + if ( $this->mTitle->exists() ) { |
| 791 | + $text = $this->getRawText(); |
| 792 | + } else { |
791 | 793 | $text = false; |
792 | | - } else { |
793 | | - $text = $this->getRawText(); |
794 | 794 | } |
795 | 795 | |
796 | 796 | MessageCache::singleton()->replace( $this->mTitle->getDBkey(), $text ); |
— | — | @@ -1985,7 +1985,7 @@ |
1986 | 1986 | } |
1987 | 1987 | |
1988 | 1988 | # Don't update page view counters on views from bot users (bug 14044) |
1989 | | - if ( !$wgDisableCounters && !$user->isAllowed( 'bot' ) && $this->getId() ) { |
| 1989 | + if ( !$wgDisableCounters && !$user->isAllowed( 'bot' ) && $this->mTitle->exists() ) { |
1990 | 1990 | DeferredUpdates::addUpdate( new ViewCountUpdate( $this->getId() ) ); |
1991 | 1991 | DeferredUpdates::addUpdate( new SiteStatsUpdate( 1, 0, 0 ) ); |
1992 | 1992 | } |
— | — | @@ -2100,15 +2100,15 @@ |
2101 | 2101 | } |
2102 | 2102 | } |
2103 | 2103 | |
| 2104 | + if ( !$this->mTitle->exists() ) { |
| 2105 | + wfProfileOut( __METHOD__ ); |
| 2106 | + return; |
| 2107 | + } |
| 2108 | + |
2104 | 2109 | $id = $this->getId(); |
2105 | 2110 | $title = $this->mTitle->getPrefixedDBkey(); |
2106 | 2111 | $shortTitle = $this->mTitle->getDBkey(); |
2107 | 2112 | |
2108 | | - if ( 0 == $id ) { |
2109 | | - wfProfileOut( __METHOD__ ); |
2110 | | - return; |
2111 | | - } |
2112 | | - |
2113 | 2113 | if ( !$options['changed'] ) { |
2114 | 2114 | $good = 0; |
2115 | 2115 | $total = 0; |