r77491 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r77490‎ | r77491 | r77492 >
Date:18:29, 30 November 2010
Author:reedy
Status:reverted (Comments)
Tags:
Comment:
Switch + to . for string concat
Modified paths:
  • /trunk/phase3/includes/Preferences.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Preferences.php
@@ -529,7 +529,7 @@
530530 $nowlocal = Xml::element( 'span', array( 'id' => 'wpLocalTime' ),
531531 $wgLang->time( $now = wfTimestampNow(), true ) );
532532 $nowserver = $wgLang->time( $now, false ) .
533 - Html::hidden( 'wpServerTime', substr( $now, 8, 2 ) * 60 + substr( $now, 10, 2 ) );
 533+ Html::hidden( 'wpServerTime', substr( $now, 8, 2 ) * 60 . substr( $now, 10, 2 ) );
534534
535535 $defaultPreferences['nowserver'] = array(
536536 'type' => 'info',

Follow-up revisions

RevisionCommit summaryAuthorDate
r77529Revert r77491reedy13:36, 1 December 2010

Comments

#Comment by P.Copp (talk | contribs)   12:57, 1 December 2010

Sure?

> php -r "var_dump('12' * 60 + '34');"
int(754)
> php -r "var_dump('12' * 60 . '34');"
string(5) "72034"
#Comment by Reedy (talk | contribs)   13:37, 1 December 2010

Yay for unobvious code

I'm guessing the substr is always going to be integer... Maybe make it more apparent with intval( substr( ) )?

Reverted..

Status & tagging log