Merge "Add redirect=no only to redirects on redirect pages"
[lhc/web/wiklou.git] / includes / page / Article.php
index e7ae446..d57d3fd 100644 (file)
@@ -225,7 +225,7 @@ class Article implements Page {
         */
        protected function getContentObject() {
 
-               if ( $this->mPage->getID() === 0 ) {
+               if ( $this->mPage->getId() === 0 ) {
                        # If this is a MediaWiki:x message, then load the messages
                        # and return the message value for x.
                        if ( $this->getTitle()->getNamespace() == NS_MEDIAWIKI ) {
@@ -282,7 +282,7 @@ class Article implements Page {
                                $this->mRevision = Revision::newFromId( $oldid );
                                if ( $this->mRevision !== null ) {
                                        // Revision title doesn't match the page title given?
-                                       if ( $this->mPage->getID() != $this->mRevision->getPage() ) {
+                                       if ( $this->mPage->getId() != $this->mRevision->getPage() ) {
                                                $function = [ get_class( $this->mPage ), 'newFromID' ];
                                                $this->mPage = call_user_func( $function, $this->mRevision->getPage() );
                                        }
@@ -636,7 +636,7 @@ class Article implements Page {
                                        # the correct version information.
                                        $outputPage->setRevisionId( $this->getRevIdFetched() );
                                        # Preload timestamp to avoid a DB hit
-                                       $outputPage->setRevisionTimestamp( $this->getTimestamp() );
+                                       $outputPage->setRevisionTimestamp( $this->mPage->getTimestamp() );
 
                                        # Pages containing custom CSS or JavaScript get special treatment
                                        if ( $this->getTitle()->isCssOrJsPage() || $this->getTitle()->isCssJsSubpage() ) {
@@ -768,7 +768,7 @@ class Article implements Page {
                                ->params( $oldid )
                                ->numParams( 1 )
                                ->parseAsBlock();
-                       $this->getContext()->getOutput()->addHtml( $msg );
+                       $this->getContext()->getOutput()->addHTML( $msg );
                        return;
                }
 
@@ -863,7 +863,7 @@ class Article implements Page {
                        }
                }
 
-               if ( $this->mPage->getID() === 0 || $this->getOldID() ) {
+               if ( $this->mPage->getId() === 0 || $this->getOldID() ) {
                        # Non-articles (special pages etc), and old revisions
                        return [
                                'index' => 'noindex',
@@ -1252,8 +1252,7 @@ class Article implements Page {
                if ( $title->getNamespace() == NS_USER
                        || $title->getNamespace() == NS_USER_TALK
                ) {
-                       $parts = explode( '/', $title->getText() );
-                       $rootPart = $parts[0];
+                       $rootPart = explode( '/', $title->getText() )[0];
                        $user = User::newFromName( $rootPart, false /* allow IP users*/ );
                        $ip = User::isIP( $rootPart );
                        $block = Block::newFromTarget( $user, $user );
@@ -1446,7 +1445,7 @@ class Article implements Page {
                $outputPage->addSubtitle( "<div id=\"mw-{$infomsg}\">" .
                        $context->msg( $infomsg, $td )
                                ->rawParams( $userlinks )
-                               ->params( $revision->getID(), $tddate, $tdtime, $revision->getUserText() )
+                               ->params( $revision->getId(), $tddate, $tdtime, $revision->getUserText() )
                                ->rawParams( Linker::revComment( $revision, true, true ) )
                                ->parse() .
                        "</div>"
@@ -1962,7 +1961,7 @@ class Article implements Page {
                $cacheable = false;
 
                if ( HTMLFileCache::useFileCache( $this->getContext() ) ) {
-                       $cacheable = $this->mPage->getID()
+                       $cacheable = $this->mPage->getId()
                                && !$this->mRedirectedFrom && !$this->getTitle()->isRedirect();
                        // Extension may have reason to disable file caching on some pages.
                        if ( $cacheable ) {