Article::getUndoText() and WikiPage::getUndoText were removed
[lhc/web/wiklou.git] / includes / page / Article.php
index f6b490a..6c42e34 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() );
                                        }
@@ -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',
@@ -1445,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>"
@@ -1572,9 +1572,8 @@ class Article implements Page {
                                $title,
                                htmlspecialchars( $title->getFullText() ),
                                [],
-                               // Automatically append redirect=no to each link, since most of them are
-                               // redirect pages themselves.
-                               [ 'redirect' => 'no' ],
+                               // Make sure wiki page redirects are not followed
+                               $title->isRedirect() ? [ 'redirect' => 'no' ] : [],
                                ( $forceKnown ? [ 'known', 'noclasses' ] : [] )
                        ) . '</li>';
                }
@@ -1644,6 +1643,7 @@ class Article implements Page {
                $title = $this->getTitle();
                $context = $this->getContext();
                $user = $context->getUser();
+               $request = $context->getRequest();
 
                # Check permissions
                $permissionErrors = $title->getUserPermissionsErrors( 'delete', $user );
@@ -1657,7 +1657,9 @@ class Article implements Page {
                }
 
                # Better double-check that it hasn't been deleted yet!
-               $this->mPage->loadPageData( 'fromdbmaster' );
+               $this->mPage->loadPageData(
+                       $request->wasPosted() ? WikiPage::READ_LATEST : WikiPage::READ_NORMAL
+               );
                if ( !$this->mPage->exists() ) {
                        $deleteLogPage = new LogPage( 'delete' );
                        $outputPage = $context->getOutput();
@@ -1677,7 +1679,6 @@ class Article implements Page {
                        return;
                }
 
-               $request = $context->getRequest();
                $deleteReasonList = $request->getText( 'wpDeleteReasonList', 'other' );
                $deleteReason = $request->getText( 'wpReason' );
 
@@ -1961,7 +1962,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 ) {
@@ -2378,15 +2379,6 @@ class Article implements Page {
                return $this->mPage->getUndoContent( $undo, $undoafter );
        }
 
-       /**
-        * Call to WikiPage function for backwards compatibility.
-        * @see WikiPage::getUndoText
-        */
-       public function getUndoText( Revision $undo, Revision $undoafter = null ) {
-               ContentHandler::deprecated( __METHOD__, '1.21' );
-               return $this->mPage->getUndoText( $undo, $undoafter );
-       }
-
        /**
         * Call to WikiPage function for backwards compatibility.
         * @see WikiPage::getUser
@@ -2549,19 +2541,6 @@ class Article implements Page {
                return $this->mPage->protectDescriptionLog( $limit, $expiry );
        }
 
-       /**
-        * Call to WikiPage function for backwards compatibility.
-        * @see WikiPage::replaceSection
-        */
-       public function replaceSection( $sectionId, $text, $sectionTitle = '',
-               $edittime = null
-       ) {
-               ContentHandler::deprecated( __METHOD__, '1.21' );
-               return $this->mPage->replaceSection( $sectionId, $text, $sectionTitle,
-                       $edittime
-               );
-       }
-
        /**
         * Call to WikiPage function for backwards compatibility.
         * @see WikiPage::replaceSectionAtRev