Followup r95449, fix the code to do what it was actually intended to do
authorSam Reed <reedy@users.mediawiki.org>
Thu, 25 Aug 2011 17:47:33 +0000 (17:47 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Thu, 25 Aug 2011 17:47:33 +0000 (17:47 +0000)
includes/db/Database.php
includes/db/DatabaseOracle.php

index fd14153..6126b35 100644 (file)
@@ -1693,7 +1693,7 @@ abstract class DatabaseBase implements DatabaseType {
                $opts = $this->makeUpdateOptions( $options );
                $sql = "UPDATE $opts $table SET " . $this->makeList( $values, LIST_SET );
 
-               if ( $conds != '*' || ( is_array( $conds ) && count( $conds ) ) ) {
+               if ( $conds !== array() && $conds !== '*' ) {
                        $sql .= " WHERE " . $this->makeList( $conds, LIST_AND );
                }
 
index 23e449a..8ede6bc 100644 (file)
@@ -1194,7 +1194,8 @@ class DatabaseOracle extends DatabaseBase {
                        $sql .= $sqlSet;
                }
 
-               if ( $conds != '*' || ( is_array( $conds ) && count( $conds ) ) ) {
+               if ( $conds !== array() && $conds !== '*' ) {
+               if ( $conds !== array() && $conds !== '*' ) {
                        $conds = $this->wrapConditionsForWhere( $table, $conds );
                        $sql .= ' WHERE ' . $this->makeList( $conds, LIST_AND );
                }