r65190 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r65189‎ | r65190 | r65191 >
Date:21:34, 17 April 2010
Author:nikerabbit
Status:ok
Tags:
Comment:
Escaping fixes, added some FIXMEs
Modified paths:
  • /trunk/extensions/CentralNotice/SpecialNoticeTemplate.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CentralNotice/SpecialNoticeTemplate.php
@@ -30,7 +30,7 @@
3131 $this->editable = $wgUser->isAllowed( 'centralnotice-admin' );
3232
3333 // Show summary
34 - $wgOut->addWikiText( wfMsg( 'centralnotice-summary' ) );
 34+ $wgOut->addWikiMsg( 'centralnotice-summary' );
3535
3636 // Show header
3737 CentralNotice::printHeader();
@@ -64,6 +64,7 @@
6565 }
6666
6767 // Handle adding
 68+ // FIXME: getText()? weak comparison
6869 if ( $wgRequest->getVal( 'wpMethod' ) == 'addTemplate' ) {
6970 $this->addTemplate(
7071 $wgRequest->getVal( 'templateName' ),
@@ -266,7 +267,7 @@
267268 if ( $this->editable ) {
268269 $htmlOut .= Xml::openElement( 'form', array( 'method' => 'post' ) );
269270 }
270 - $htmlOut .= Xml::fieldset( wfMsgHtml( 'centralnotice-translate-heading', $currentTemplate ) );
 271+ $htmlOut .= Xml::fieldset( wfMsg( 'centralnotice-translate-heading', $currentTemplate ) );
271272 $htmlOut .= Xml::openElement( 'table',
272273 array (
273274 'cellpadding' => 9,
@@ -348,7 +349,7 @@
349350 $htmlOut .= Xml::hidden( 'wpUserLanguage', $wpUserLang );
350351 $htmlOut .= Xml::openElement( 'tr' );
351352 $htmlOut .= Xml::tags( 'td', array( 'colspan' => 4 ),
352 - Xml::submitButton( wfMsg( 'centralnotice-modify', array( 'name' => 'update' ) ) )
 353+ Xml::submitButton( wfMsg( 'centralnotice-modify' ), array( 'name' => 'update' ) )
353354 );
354355 $htmlOut .= Xml::closeElement( 'tr' );
355356 }
@@ -362,7 +363,7 @@
363364 * Show language selection form
364365 */
365366 $htmlOut .= Xml::openElement( 'form', array( 'method' => 'post' ) );
366 - $htmlOut .= Xml::fieldset( wfMsgHtml( 'centralnotice-change-lang' ) );
 367+ $htmlOut .= Xml::fieldset( wfMsg( 'centralnotice-change-lang' ) );
367368 $htmlOut .= Xml::openElement( 'table', array ( 'cellpadding' => 9 ) );
368369 list( $lsLabel, $lsSelect ) = Xml::languageSelector( $wpUserLang );
369370
@@ -377,7 +378,7 @@
378379 );
379380 $htmlOut .= Xml::tags( 'tr', null,
380381 Xml::tags( 'td', null, '' ) .
381 - Xml::tags( 'td', null, $sk->makeLinkObj( $newPage, wfMsg( 'centralnotice-preview-all-template-translations' ), "template=$currentTemplate&wpUserLanguage=all" ) )
 382+ Xml::tags( 'td', null, $sk->makeLinkObj( $newPage, wfMsgHtml( 'centralnotice-preview-all-template-translations' ), "template=$currentTemplate&wpUserLanguage=all" ) )
382383 );
383384 $htmlOut .= Xml::closeElement( 'table' );
384385 $htmlOut .= Xml::closeElement( 'fieldset' );
@@ -390,7 +391,7 @@
391392 $htmlOut .= Xml::openElement( 'form', array( 'method' => 'post' ) );
392393 $htmlOut .= Xml::hidden( 'wpMethod', 'editTemplate' );
393394 }
394 - $htmlOut .= Xml::fieldset( wfMsgHtml( 'centralnotice-edit-template' ) );
 395+ $htmlOut .= Xml::fieldset( wfMsg( 'centralnotice-edit-template' ) );
395396 $htmlOut .= Xml::openElement( 'table',
396397 array(
397398 'cellpadding' => 9,
@@ -402,7 +403,7 @@
403404 );
404405 if ( $this->editable ) {
405406 $htmlOut .= Xml::tags( 'tr', null,
406 - Xml::tags( 'td', null, Xml::submitButton( wfMsgHtml( 'centralnotice-modify' ) ) )
 407+ Xml::tags( 'td', null, Xml::submitButton( wfMsg( 'centralnotice-modify' ) ) )
407408 );
408409 }
409410 $htmlOut .= Xml::closeElement( 'table' );
@@ -425,6 +426,7 @@
426427 $htmlOut .= Xml::fieldset( wfMsg( 'centralnotice-clone-notice' ) );
427428 $htmlOut .= Xml::openElement( 'table', array( 'cellpadding' => 9 ) );
428429 $htmlOut .= Xml::openElement( 'tr' );
 430+ // FIXME: hardcoded text?
429431 $htmlOut .= Xml::inputLabel( 'Name:', 'newTemplate', 'newTemplate, 25' );
430432 $htmlOut .= Xml::submitButton( wfMsg( 'centralnotice-clone' ), array ( 'id' => 'clone' ) );
431433 $htmlOut .= Xml::hidden( 'oldTemplate', $currentTemplate );
@@ -516,7 +518,9 @@
517519 private function removeTemplate ( $name ) {
518520 global $wgOut, $egCentralNoticeTables;
519521
 522+ // FIXME: weak comparison
520523 if ( $name == '' ) {
 524+ // FIXME: message not defined?
521525 $wgOut->addHTML( wfMsg( 'centralnotice-template-doesnt-exist' ) );
522526 return;
523527 }
@@ -526,7 +530,7 @@
527531 $res = $dbr->select( 'cn_assignments', 'asn_id', array( 'tmp_id' => $id ), __METHOD__ );
528532
529533 if ( $dbr->numRows( $res ) > 0 ) {
530 - $wgOut->addHTML( wfMsg( 'centralnotice-template-still-bound' ) );
 534+ $wgOut->addWikiMsg( 'centralnotice-template-still-bound' );
531535 return;
532536 } else {
533537 $dbw = wfGetDB( DB_MASTER );
@@ -548,7 +552,7 @@
549553 global $wgOut, $egCentralNoticeTables;
550554
551555 if ( $body == '' || $name == '' ) {
552 - $wgOut->addHTML( wfMsg( 'centralnotice-null-string' ) );
 556+ $wgOut->addWikiMsg( 'centralnotice-null-string' );
553557 return;
554558 }
555559
@@ -562,7 +566,7 @@
563567 );
564568
565569 if ( $dbr->numRows( $res ) > 0 ) {
566 - $wgOut->addHTML( wfMsg( 'centralnotice-template-exists' ) );
 570+ $wgOut->addWikiMsg( 'centralnotice-template-exists' );
567571 return false;
568572 } else {
569573 $dbw = wfGetDB( DB_MASTER );
@@ -588,7 +592,7 @@
589593 global $wgOut, $egCentralNoticeTables;
590594
591595 if ( $body == '' || $name == '' ) {
592 - $wgOut->addHTML( wfMsg( 'centralnotice-null-string' ) );
 596+ $wgOut->addWikiMsg( 'centralnotice-null-string' );
593597 return;
594598 }
595599

Follow-up revisions

RevisionCommit summaryAuthorDate
r65194Follow up r65190 with more wfMsg changes.platonides21:57, 17 April 2010

Status & tagging log