Make WordPress Core


Ignore:
Timestamp:
09/02/2014 04:55:17 AM (11 years ago)
Author:
nacin
Message:

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

see #26106.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/wp-db.php

    r29165 r29664  
    17941794        }
    17951795
    1796         $wheres = empty( $where ) ? '' : ( ' WHERE ' . implode( ' AND ', $wheres ) );
    1797 
    1798         $sql = "UPDATE `$table` SET " . implode( ', ', $bits ) . $wheres;
     1796        $sql = "UPDATE `$table` SET " . implode( ', ', $bits ) . ' WHERE ' . implode( ' AND ', $wheres );
    17991797        return $this->query( $this->prepare( $sql, array_merge( array_values( $data ), array_values( $where ) ) ) );
    18001798    }
Note: See TracChangeset for help on using the changeset viewer.