r85020 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r85019‎ | r85020 | r85021 >
Date:17:04, 30 March 2011
Author:happy-melon
Status:ok (Comments)
Tags:
Comment:
(bug 18937) avoid broken wikimarkup (four apostrophes together) in MediaWiki:Confirmrecreate when there is no deletion reason, by using a separate message.
Modified paths:
  • /trunk/phase3/includes/EditPage.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)
  • /trunk/phase3/maintenance/language/messages.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/language/messages.inc
@@ -3045,6 +3045,7 @@
30463046 'deleteconflict' => array(
30473047 'deletedwhileediting',
30483048 'confirmrecreate',
 3049+ 'confirmrecreate-noreason',
30493050 'recreate',
30503051 ),
30513052 'unit-pixel' => array(
Index: trunk/phase3/includes/EditPage.php
@@ -1356,9 +1356,10 @@
13571357
13581358 // It is better to not parse the comment at all than to have templates expanded in the middle
13591359 // TODO: can the checkLabel be moved outside of the div so that wrapWikiMsg could be used?
 1360+ $key = $comment ? 'confirmrecreate' : 'confirmrecreate-noreason';
13601361 $wgOut->addHTML(
13611362 '<div class="mw-confirm-recreate">' .
1362 - wfMsgExt( 'confirmrecreate', 'parseinline', $username, "<nowiki>$comment</nowiki>" ) .
 1363+ wfMsgExt( $key, 'parseinline', $username, "<nowiki>$comment</nowiki>" ) .
13631364 Xml::checkLabel( wfMsg( 'recreate' ), 'wpRecreate', 'wpRecreate', false,
13641365 array( 'title' => $sk->titleAttrib( 'recreate' ), 'tabindex' => 1, 'id' => 'wpRecreate' )
13651366 ) .
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -4141,6 +4141,7 @@
41424142 'confirmrecreate' => "User [[User:$1|$1]] ([[User talk:$1|talk]]) deleted this page after you started editing with reason:
41434143 : ''$2''
41444144 Please confirm that you really want to recreate this page.",
 4145+'confirmrecreate-noreason' => "User [[User:$1|$1]] ([[User talk:$1|talk]]) deleted this page after you started editing. Please confirm that you really want to recreate this page.",
41454146 'recreate' => 'Recreate',
41464147
41474148 'unit-pixel' => 'px', # only translate this message to other languages if you have to change it

Follow-up revisions

RevisionCommit summaryAuthorDate
r85026Follow-up r85020 per CR - use strict comparisonhappy-melon18:06, 30 March 2011

Comments

#Comment by IAlex (talk | contribs)   17:09, 30 March 2011

Please use strict comparaison, i.e. $comment === '', since the current check will also detect "0" as false and thus show the new message.

Status & tagging log