r71679 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r71678‎ | r71679 | r71680 >
Date:00:18, 26 August 2010
Author:kaldari
Status:ok
Tags:
Comment:
better way to restore banner body
Modified paths:
  • /trunk/extensions/CentralNotice/SpecialNoticeTemplate.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CentralNotice/SpecialNoticeTemplate.php
@@ -237,12 +237,9 @@
238238 array( 'style' => 'margin-bottom: 0.2em;' ),
239239 '<img src="'.$scriptPath.'/down-arrow.png" style="vertical-align:baseline;"/>' . wfMsg( 'centralnotice-insert', $wgLang->commaList( $buttons ) )
240240 );
241 - $body = '';
242241
243242 // Restore banner body state in the event of an error on form submit
244 - if ( $wgRequest->getVal( 'templateBody' ) ) {
245 - $body = $wgRequest->getVal( 'templateBody' );
246 - }
 243+ $body = $wgRequest->getVal( 'templateBody', '' )
247244
248245 $htmlOut .= Xml::textarea( 'templateBody', $body, 60, 20 );
249246 $htmlOut .= Xml::closeElement( 'fieldset' );
@@ -328,9 +325,7 @@
329326 preg_match_all( "/\{\{\{([$allowedChars]+)\}\}\}/u", $body, $fields );
330327
331328 // Restore banner body state in the event of an error on form submit
332 - if ( $wgRequest->getVal( 'templateBody' ) ) {
333 - $body = $wgRequest->getVal( 'templateBody' );
334 - }
 329+ $body = $wgRequest->getVal( 'templateBody', $body );
335330
336331 // If there are any message fields in the banner, display translation tools.
337332 if ( count( $fields[0] ) > 0 ) {

Follow-up revisions

RevisionCommit summaryAuthorDate
r71682missing a semicolon in r71679kaldari00:33, 26 August 2010

Status & tagging log