Make WordPress Core

Changeset 21178


Ignore:
Timestamp:
06/29/2012 03:08:17 PM (12 years ago)
Author:
nacin
Message:

Correctly identify queries where a line break follows a keyword, rather than a space. props GeertDD, fixes #19467.

File:
1 edited

Legend:

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

    r21161 r21178  
    11071107        }
    11081108
    1109         if ( preg_match( '/^\s*(create|alter|truncate|drop) /i', $query ) ) {
     1109        if ( preg_match( '/^\s*(create|alter|truncate|drop)\s/i', $query ) ) {
    11101110            $return_val = $this->result;
    1111         } elseif ( preg_match( '/^\s*(insert|delete|update|replace) /i', $query ) ) {
     1111        } elseif ( preg_match( '/^\s*(insert|delete|update|replace)\s/i', $query ) ) {
    11121112            $this->rows_affected = mysql_affected_rows( $this->dbh );
    11131113            // Take note of the insert_id
    1114             if ( preg_match( '/^\s*(insert|replace) /i', $query ) ) {
     1114            if ( preg_match( '/^\s*(insert|replace)\s/i', $query ) ) {
    11151115                $this->insert_id = mysql_insert_id($this->dbh);
    11161116            }
Note: See TracChangeset for help on using the changeset viewer.