Pass user to WikiPage::doDeleteArticleReal
[lhc/web/wiklou.git] / includes / page / Article.php
index 11a3638..f213f6a 100644 (file)
@@ -333,7 +333,9 @@ class Article implements Page {
         * @return string|bool String containing article contents, or false if null
         * @deprecated since 1.21, use WikiPage::getContent() instead
         */
-       function fetchContent() { #BC cruft!
+       function fetchContent() {
+               // BC cruft!
+
                ContentHandler::deprecated( __METHOD__, '1.21' );
 
                if ( $this->mContentLoaded && $this->mContent ) {
@@ -572,7 +574,7 @@ class Article implements Page {
                }
 
                # Should the parser cache be used?
-               $useParserCache = $this->mPage->isParserCacheUsed( $parserOptions, $oldid );
+               $useParserCache = $this->mPage->shouldCheckParserCache( $parserOptions, $oldid );
                wfDebug( 'Article::view using parser cache: ' . ( $useParserCache ? 'yes' : 'no' ) . "\n" );
                if ( $user->getStubThreshold() ) {
                        $this->getContext()->getStats()->increment( 'pcache_miss_stub' );
@@ -998,7 +1000,7 @@ class Article implements Page {
                                $outputPage->addModules( 'mediawiki.action.view.redirect' );
 
                                // Add a <link rel="canonical"> tag
-                               $outputPage->setCanonicalUrl( $this->getTitle()->getLocalURL() );
+                               $outputPage->setCanonicalUrl( $this->getTitle()->getCanonicalURL() );
 
                                // Tell the output object that the user arrived at this article through a redirect
                                $outputPage->setRedirectedFrom( $this->mRedirectedFrom );
@@ -1704,10 +1706,8 @@ class Article implements Page {
 
                if ( $user->isAllowed( 'suppressrevision' ) ) {
                        $suppress = Html::openElement( 'div', array( 'id' => 'wpDeleteSuppressRow' ) ) .
-                               "<strong>" .
-                                               Xml::checkLabel( wfMessage( 'revdelete-suppress' )->text(),
-                                                       'wpSuppress', 'wpSuppress', false, array( 'tabindex' => '4' ) ) .
-                                       "</strong>" .
+                               Xml::checkLabel( wfMessage( 'revdelete-suppress' )->text(),
+                                       'wpSuppress', 'wpSuppress', false, array( 'tabindex' => '4' ) ) .
                                Html::closeElement( 'div' );
                } else {
                        $suppress = '';
@@ -1772,7 +1772,7 @@ class Article implements Page {
                        Xml::closeElement( 'form' );
 
                        if ( $user->isAllowed( 'editinterface' ) ) {
-                               $link = Linker::link(
+                               $link = Linker::linkKnown(
                                        $ctx->msg( 'deletereason-dropdown' )->inContentLanguage()->getTitle(),
                                        wfMessage( 'delete-edit-reasonlist' )->escaped(),
                                        array(),
@@ -1795,8 +1795,10 @@ class Article implements Page {
         */
        public function doDelete( $reason, $suppress = false ) {
                $error = '';
-               $outputPage = $this->getContext()->getOutput();
-               $status = $this->mPage->doDeleteArticleReal( $reason, $suppress, 0, true, $error );
+               $context = $this->getContext();
+               $outputPage = $context->getOutput();
+               $user = $context->getUser();
+               $status = $this->mPage->doDeleteArticleReal( $reason, $suppress, 0, true, $error, $user );
 
                if ( $status->isGood() ) {
                        $deleted = $this->getTitle()->getPrefixedText();