Merge "Replace misplaced strlen() checks with strict `false` comparisons"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 27 Mar 2019 18:01:36 +0000 (18:01 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 27 Mar 2019 18:01:36 +0000 (18:01 +0000)
includes/externalstore/ExternalStore.php
includes/libs/rdbms/database/Database.php

index de7d1a4..9cf8e15 100644 (file)
@@ -197,7 +197,7 @@ class ExternalStore {
                                        $msg = 'read only';
                                } else {
                                        $url = $store->store( $path, $data );
-                                       if ( strlen( $url ) ) {
+                                       if ( $url !== false ) {
                                                return $url; // a store accepted the write; done!
                                        }
                                        $msg = 'operation failed';
index dea7aab..fcd15f1 100644 (file)
@@ -2547,7 +2547,7 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
                        throw new InvalidArgumentException( "Table must be a string or Subquery." );
                }
 
-               if ( !strlen( $alias ) || $alias === $table ) {
+               if ( $alias === false || $alias === $table ) {
                        if ( $table instanceof Subquery ) {
                                throw new InvalidArgumentException( "Subquery table missing alias." );
                        }