Merge "(bug 50078) Allow a string other than '*' as condition for DatabaseBase::delete()"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Tue, 25 Jun 2013 17:18:10 +0000 (17:18 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Tue, 25 Jun 2013 17:18:10 +0000 (17:18 +0000)
includes/db/Database.php

index 4b2eae7..e06d80d 100644 (file)
@@ -2712,7 +2712,10 @@ abstract class DatabaseBase implements DatabaseType {
                $sql = "DELETE FROM $table";
 
                if ( $conds != '*' ) {
-                       $sql .= ' WHERE ' . $this->makeList( $conds, LIST_AND );
+                       if ( is_array( $conds ) ) {
+                               $conds = $this->makeList( $conds, LIST_AND );
+                       }
+                       $sql .= ' WHERE ' . $conds;
                }
 
                return $this->query( $sql, $fname );