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

git-svn-id: http://core.svn.wordpress.org/trunk@21178 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
nacin 2012-06-29 15:08:17 +00:00
parent c00968bee0
commit 3e8fe0e2e0
1 changed files with 3 additions and 3 deletions

View File

@ -1106,12 +1106,12 @@ class wpdb {
return false; return false;
} }
if ( preg_match( '/^\s*(create|alter|truncate|drop) /i', $query ) ) { if ( preg_match( '/^\s*(create|alter|truncate|drop)\s/i', $query ) ) {
$return_val = $this->result; $return_val = $this->result;
} elseif ( preg_match( '/^\s*(insert|delete|update|replace) /i', $query ) ) { } elseif ( preg_match( '/^\s*(insert|delete|update|replace)\s/i', $query ) ) {
$this->rows_affected = mysql_affected_rows( $this->dbh ); $this->rows_affected = mysql_affected_rows( $this->dbh );
// Take note of the insert_id // Take note of the insert_id
if ( preg_match( '/^\s*(insert|replace) /i', $query ) ) { if ( preg_match( '/^\s*(insert|replace)\s/i', $query ) ) {
$this->insert_id = mysql_insert_id($this->dbh); $this->insert_id = mysql_insert_id($this->dbh);
} }
// Return number of rows affected // Return number of rows affected