DB: Revert [28814] and require a WHERE for wpdb::update().

see #26106.


git-svn-id: https://develop.svn.wordpress.org/trunk@29664 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin
2014-09-02 04:55:17 +00:00
parent 7c09b36829
commit 1cde8312b6
2 changed files with 8 additions and 5 deletions

View File

@@ -1793,9 +1793,7 @@ class wpdb {
$wheres[] = "`$field` = {$form}";
}
$wheres = empty( $where ) ? '' : ( ' WHERE ' . implode( ' AND ', $wheres ) );
$sql = "UPDATE `$table` SET " . implode( ', ', $bits ) . $wheres;
$sql = "UPDATE `$table` SET " . implode( ', ', $bits ) . ' WHERE ' . implode( ' AND ', $wheres );
return $this->query( $this->prepare( $sql, array_merge( array_values( $data ), array_values( $where ) ) ) );
}