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

see #26106.

Built from https://develop.svn.wordpress.org/trunk@29664


git-svn-id: http://core.svn.wordpress.org/trunk@29438 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2014-09-02 04:56:15 +00:00
parent 4417e75e2c
commit 53f1ba51e4

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 ) ) ) );
}