Umherirrender has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/180205

Change subject: Use Context in Article::delete for messages
......................................................................

Use Context in Article::delete for messages

Also escape a 'word-separator' message while at the line

Change-Id: If6212dfa685378978b61755cc56fe6d88971d625
---
M includes/page/Article.php
1 file changed, 11 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/05/180205/1

diff --git a/includes/page/Article.php b/includes/page/Article.php
index 0318f65..a4996df 100644
--- a/includes/page/Article.php
+++ b/includes/page/Article.php
@@ -1559,7 +1559,8 @@
                # This code desperately needs to be totally rewritten
 
                $title = $this->getTitle();
-               $user = $this->getContext()->getUser();
+               $context = $this->getContext();
+               $user = $context->getUser();
 
                # Check permissions
                $permissionErrors = $title->getUserPermissionsErrors( 'delete', 
$user );
@@ -1576,8 +1577,8 @@
                $this->mPage->loadPageData( 'fromdbmaster' );
                if ( !$this->mPage->exists() ) {
                        $deleteLogPage = new LogPage( 'delete' );
-                       $outputPage = $this->getContext()->getOutput();
-                       $outputPage->setPageTitle( wfMessage( 
'cannotdelete-title', $title->getPrefixedText() ) );
+                       $outputPage = $context->getOutput();
+                       $outputPage->setPageTitle( $context->msg( 
'cannotdelete-title', $title->getPrefixedText() ) );
                        $outputPage->wrapWikiMsg( "<div class=\"error 
mw-error-cannotdelete\">\n$1\n</div>",
                                        array( 'cannotdelete', 
wfEscapeWikiText( $title->getPrefixedText() ) )
                                );
@@ -1593,7 +1594,7 @@
                        return;
                }
 
-               $request = $this->getContext()->getRequest();
+               $request = $context->getRequest();
                $deleteReasonList = $request->getText( 'wpDeleteReasonList', 
'other' );
                $deleteReason = $request->getText( 'wpReason' );
 
@@ -1651,11 +1652,11 @@
                        );
 
                        // @todo FIXME: i18n issue/patchwork message
-                       $this->getContext()->getOutput()->addHTML(
+                       $context->getOutput()->addHTML(
                                '<strong class="mw-delete-warning-revisions">' .
-                               wfMessage( 'historywarning' )->numParams( 
$revisions )->parse() .
-                               wfMessage( 'word-separator' )->plain() . 
Linker::linkKnown( $title,
-                                       wfMessage( 'history' )->escaped(),
+                               $context->msg( 'historywarning' )->numParams( 
$revisions )->parse() .
+                               $context->msg( 'word-separator' )->escaped() . 
Linker::linkKnown( $title,
+                                       $context->msg( 'history' )->escaped(),
                                        array( 'rel' => 'archives' ),
                                        array( 'action' => 'history' ) ) .
                                '</strong>'
@@ -1663,10 +1664,10 @@
 
                        if ( $title->isBigDeletion() ) {
                                global $wgDeleteRevisionsLimit;
-                               $this->getContext()->getOutput()->wrapWikiMsg( 
"<div class='error'>\n$1\n</div>\n",
+                               $context->getOutput()->wrapWikiMsg( "<div 
class='error'>\n$1\n</div>\n",
                                        array(
                                                'delete-warning-toobig',
-                                               
$this->getContext()->getLanguage()->formatNum( $wgDeleteRevisionsLimit )
+                                               
$context->getLanguage()->formatNum( $wgDeleteRevisionsLimit )
                                        )
                                );
                        }

-- 
To view, visit https://gerrit.wikimedia.org/r/180205
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If6212dfa685378978b61755cc56fe6d88971d625
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Umherirrender <umherirrender_de...@web.de>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to