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

git-svn-id: https://develop.svn.wordpress.org/trunk@21178 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2012-06-29 15:08:17 +00:00
parent a9643d617a
commit 9db38e39ab
1 changed files with 3 additions and 3 deletions

View File

@ -1106,12 +1106,12 @@ class wpdb {
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;
} 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 );
// 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);
}
// Return number of rows affected