r80341 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r80340‎ | r80341 | r80342 >
Date:22:46, 14 January 2011
Author:dantman
Status:ok
Tags:
Comment:
Fix boolean for $editnotice_base message existance check that was messed up in r80248.
Also switch to using === for '' and '-' comparison like Nikerabbit wanted.
Modified paths:
  • /trunk/phase3/includes/EditPage.php (modified) (history)
  • /trunk/phase3/includes/Message.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Message.php
@@ -314,7 +314,7 @@
315315 */
316316 public function isBlank() {
317317 $message = $this->fetchMessage();
318 - return $message === false || $message == '';
 318+ return $message === false || $message === '';
319319 }
320320
321321 /**
@@ -323,7 +323,7 @@
324324 */
325325 public function isDisabled() {
326326 $message = $this->fetchMessage();
327 - return $message === false || $message == '' || $message == '-';
 327+ return $message === false || $message === '' || $message === '-';
328328 }
329329
330330 public static function rawParam( $value ) {
Index: trunk/phase3/includes/EditPage.php
@@ -400,7 +400,7 @@
401401 while ( count( $parts ) > 0 ) {
402402 $editnotice_base .= '-'.array_shift( $parts );
403403 $editnotice_base_msg = wfMessage( $editnotice_base )->inContentLanguage();
404 - if ( !$editnotice_base_msg->exists() ) {
 404+ if ( $editnotice_base_msg->exists() ) {
405405 $wgOut->addWikiText( $editnotice_base_msg->plain() );
406406 }
407407 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r80248Implement Message::isBlank and Message::isDisabled....dantman10:51, 14 January 2011

Status & tagging log