r30104 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r30103‎ | r30104 | r30105 >
Date:02:00, 24 January 2008
Author:simetrical
Status:old
Tags:
Comment:
Comment tweak, remove strcmp().
Modified paths:
  • /trunk/phase3/includes/User.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/User.php
@@ -2018,11 +2018,11 @@
20192019
20202020
20212021 /**
2022 - * Checks if a user with the given name exists, returns the ID
 2022+ * Checks if a user with the given name exists, returns the ID.
20232023 */
20242024 function idForName() {
20252025 $s = trim( $this->getName() );
2026 - if ( 0 == strcmp( '', $s ) ) return 0;
 2026+ if ( $s === '' ) return 0;
20272027
20282028 $dbr = wfGetDB( DB_SLAVE );
20292029 $id = $dbr->selectField( 'user', 'user_id', array( 'user_name' => $s ), __METHOD__ );

Status & tagging log