Index: trunk/phase3/includes/Article.php |
— | — | @@ -117,7 +117,7 @@ |
118 | 118 | $text = $this->getContent(); |
119 | 119 | return self::followRedirectText( $text ); |
120 | 120 | } |
121 | | - |
| 121 | + |
122 | 122 | /** |
123 | 123 | * Get the Title object this text redirects to |
124 | 124 | * |
— | — | @@ -552,9 +552,9 @@ |
553 | 553 | */ |
554 | 554 | function isRedirect( $text = false ) { |
555 | 555 | if ( $text === false ) { |
556 | | - if ( $this->mDataLoaded ) |
| 556 | + if ( $this->mDataLoaded ) |
557 | 557 | return $this->mIsRedirect; |
558 | | - |
| 558 | + |
559 | 559 | // Apparently loadPageData was never called |
560 | 560 | $this->loadContent(); |
561 | 561 | $titleObj = Title::newFromRedirect( $this->fetchContent() ); |
— | — | @@ -659,7 +659,7 @@ |
660 | 660 | |
661 | 661 | if ($limit > 0) { $sql .= ' LIMIT '.$limit; } |
662 | 662 | if ($offset > 0) { $sql .= ' OFFSET '.$offset; } |
663 | | - |
| 663 | + |
664 | 664 | $sql .= ' '. $this->getSelectOptions(); |
665 | 665 | |
666 | 666 | $res = $dbr->query($sql, __METHOD__); |
— | — | @@ -842,7 +842,7 @@ |
843 | 843 | } |
844 | 844 | } |
845 | 845 | } |
846 | | - |
| 846 | + |
847 | 847 | $wgOut->setRevisionId( $this->getRevIdFetched() ); |
848 | 848 | |
849 | 849 | // Pages containing custom CSS or JavaScript get special treatment |
— | — | @@ -927,13 +927,13 @@ |
928 | 928 | $this->viewUpdates(); |
929 | 929 | wfProfileOut( __METHOD__ ); |
930 | 930 | } |
931 | | - |
932 | | - /* |
| 931 | + |
| 932 | + /* |
933 | 933 | * Should the parser cache be used? |
934 | 934 | */ |
935 | 935 | protected function useParserCache( $oldid ) { |
936 | 936 | global $wgUser, $wgEnableParserCache; |
937 | | - |
| 937 | + |
938 | 938 | return $wgEnableParserCache |
939 | 939 | && intval( $wgUser->getOption( 'stubthreshold' ) ) == 0 |
940 | 940 | && $this->exists() |
— | — | @@ -941,7 +941,7 @@ |
942 | 942 | && !$this->mTitle->isCssOrJsPage() |
943 | 943 | && !$this->mTitle->isCssJsSubpage(); |
944 | 944 | } |
945 | | - |
| 945 | + |
946 | 946 | /** |
947 | 947 | * View redirect |
948 | 948 | * @param Title $target Title of destination to redirect |
— | — | @@ -950,11 +950,11 @@ |
951 | 951 | */ |
952 | 952 | public function viewRedirect( $target, $appendSubtitle = true, $forceKnown = false ) { |
953 | 953 | global $wgParser, $wgOut, $wgContLang, $wgStylePath, $wgUser; |
954 | | - |
| 954 | + |
955 | 955 | # Display redirect |
956 | 956 | $imageDir = $wgContLang->isRTL() ? 'rtl' : 'ltr'; |
957 | 957 | $imageUrl = $wgStylePath.'/common/images/redirect' . $imageDir . '.png'; |
958 | | - |
| 958 | + |
959 | 959 | if( $appendSubtitle ) { |
960 | 960 | $wgOut->appendSubtitle( wfMsgHtml( 'redirectpagesub' ) ); |
961 | 961 | } |
— | — | @@ -966,7 +966,7 @@ |
967 | 967 | |
968 | 968 | return '<img src="'.$imageUrl.'" alt="#REDIRECT " />' . |
969 | 969 | '<span class="redirectText">'.$link.'</span>'; |
970 | | - |
| 970 | + |
971 | 971 | } |
972 | 972 | |
973 | 973 | function addTrackbacks() { |
— | — | @@ -1546,7 +1546,7 @@ |
1547 | 1547 | |
1548 | 1548 | # Update the page record with revision data |
1549 | 1549 | $this->updateRevisionOn( $dbw, $revision, 0 ); |
1550 | | - |
| 1550 | + |
1551 | 1551 | wfRunHooks( 'NewRevisionFromEditComplete', array($this, $revision, false) ); |
1552 | 1552 | |
1553 | 1553 | if( !( $flags & EDIT_SUPPRESS_RC ) ) { |
— | — | @@ -1909,14 +1909,14 @@ |
1910 | 1910 | 'page_id' => $id |
1911 | 1911 | ), 'Article::protect' |
1912 | 1912 | ); |
1913 | | - |
| 1913 | + |
1914 | 1914 | wfRunHooks( 'NewRevisionFromEditComplete', array($this, $nullRevision, $latest) ); |
1915 | 1915 | wfRunHooks( 'ArticleProtectComplete', array( &$this, &$wgUser, $limit, $reason ) ); |
1916 | 1916 | |
1917 | 1917 | # Update the protection log |
1918 | 1918 | $log = new LogPage( 'protect' ); |
1919 | 1919 | if( $protect ) { |
1920 | | - $log->addEntry( $modified ? 'modify' : 'protect', $this->mTitle, |
| 1920 | + $log->addEntry( $modified ? 'modify' : 'protect', $this->mTitle, |
1921 | 1921 | trim( $reason . " [$updated]$cascade_description$expiry_description" ) ); |
1922 | 1922 | } else { |
1923 | 1923 | $log->addEntry( 'unprotect', $this->mTitle, $reason ); |
— | — | @@ -2270,9 +2270,9 @@ |
2271 | 2271 | function doDelete( $reason, $suppress = false ) { |
2272 | 2272 | global $wgOut, $wgUser; |
2273 | 2273 | wfDebug( __METHOD__."\n" ); |
2274 | | - |
| 2274 | + |
2275 | 2275 | $id = $this->getId(); |
2276 | | - |
| 2276 | + |
2277 | 2277 | $error = ''; |
2278 | 2278 | |
2279 | 2279 | if (wfRunHooks('ArticleDelete', array(&$this, &$wgUser, &$reason, &$error))) { |
— | — | @@ -2547,14 +2547,14 @@ |
2548 | 2548 | if( empty( $summary ) ){ |
2549 | 2549 | $summary = wfMsgForContent( 'revertpage' ); |
2550 | 2550 | } |
2551 | | - |
| 2551 | + |
2552 | 2552 | # Allow the custom summary to use the same args as the default message |
2553 | 2553 | $args = array( |
2554 | 2554 | $target->getUserText(), $from, $s->rev_id, |
2555 | 2555 | $wgLang->timeanddate(wfTimestamp(TS_MW, $s->rev_timestamp), true), |
2556 | 2556 | $current->getId(), $wgLang->timeanddate($current->getTimestamp()) |
2557 | 2557 | ); |
2558 | | - $summary = wfMsgReplaceArgs( $summary, $args ); |
| 2558 | + $summary = wfMsgReplaceArgs( $summary, $args ); |
2559 | 2559 | |
2560 | 2560 | # Save |
2561 | 2561 | $flags = EDIT_UPDATE; |
— | — | @@ -2642,7 +2642,7 @@ |
2643 | 2643 | . $wgUser->getSkin()->userToolLinks( $target->getUser(), $target->getUserText() ); |
2644 | 2644 | $wgOut->addHtml( wfMsgExt( 'rollback-success', array( 'parse', 'replaceafter' ), $old, $new ) ); |
2645 | 2645 | $wgOut->returnToMain( false, $this->mTitle ); |
2646 | | - |
| 2646 | + |
2647 | 2647 | if( !$wgRequest->getBool( 'hidediff', false ) ) { |
2648 | 2648 | $de = new DifferenceEngine( $this->mTitle, $current->getId(), 'next', false, true ); |
2649 | 2649 | $de->showDiff( '', '' ); |
— | — | @@ -2770,7 +2770,7 @@ |
2771 | 2771 | if( User::isIP( $shortTitle ) ) { |
2772 | 2772 | // An anonymous user |
2773 | 2773 | $other->setNewtalk( true ); |
2774 | | - } elseif( $other->isLoggedIn() ) { |
| 2774 | + } elseif( $other instanceof User && $other->isLoggedIn() ) { |
2775 | 2775 | $other->setNewtalk( true ); |
2776 | 2776 | } else { |
2777 | 2777 | wfDebug( __METHOD__. ": don't need to notify a nonexistent user\n" ); |
— | — | @@ -3014,7 +3014,7 @@ |
3015 | 3015 | $revision->insertOn( $dbw ); |
3016 | 3016 | $this->updateRevisionOn( $dbw, $revision ); |
3017 | 3017 | $dbw->commit(); |
3018 | | - |
| 3018 | + |
3019 | 3019 | wfRunHooks( 'NewRevisionFromEditComplete', array($this, $revision, false) ); |
3020 | 3020 | |
3021 | 3021 | wfProfileOut( __METHOD__ ); |