From: Sam Reed Date: Wed, 6 Jan 2010 19:59:42 +0000 (+0000) Subject: Attempt at normalistion of comparison styles - empty string on left and right hand... X-Git-Tag: 1.31.0-rc.0~38384 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/journal.php?a=commitdiff_plain;h=b6e0df246f8dda61643d9aba36d9f9e802c909ec;p=lhc%2Fweb%2Fwiklou.git Attempt at normalistion of comparison styles - empty string on left and right hand side normalised to it being on the rhs Before this change, there were (? being regex 0 or 1) "" ===? 1 '' ===? 24 "" !==? 8 '' !==? 32 == "" 14 == '' 344 != "" 9 !== "" 4 != '' 151 !== '' 85 Rhs was the much more common, and the preferred style by many developers.. (Was a similar discussion in #mediawiki recently.. After that lolbugreport i think) Where there is a string (non empty) on the lhs, and variable/method call on the rhs still need normalising --- diff --git a/includes/ChangesList.php b/includes/ChangesList.php index bc776fd7af..ee5611d4a9 100644 --- a/includes/ChangesList.php +++ b/includes/ChangesList.php @@ -262,7 +262,7 @@ class ChangesList { # Make date header if necessary $date = $wgLang->date( $rc_timestamp, true, true ); if( $date != $this->lastdate ) { - if( '' != $this->lastdate ) { + if( $this->lastdate != '' ) { $s .= "\n"; } $s .= Xml::element( 'h4', null, $date ) . "\n