[wp-trac] [WordPress Trac] #30595: mysqli_fetch_object is called on results from SET queries
WordPress Trac
noreply at wordpress.org
Thu Dec 4 16:10:38 UTC 2014
#30595: mysqli_fetch_object is called on results from SET queries
--------------------------+------------------------------
Reporter: thasmin | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Database | Version: 4.0.1
Severity: normal | Resolution:
Keywords: | Focuses:
--------------------------+------------------------------
Description changed by ocean90:
Old description:
> When performing a query, Wordpress filters out create, alter, truncate,
> drop, insert, delete, update, and replace queries so they don't call
> mysqli_fetch_object. These queries return a boolean, not a mysqli_result
> object and the call to mysqli_fetch_object gives an invalid argument. Set
> queries need to be added to this list.
>
> Specifically, the '/^\s*(create|alter|truncate|drop)\s/i' regular
> expression needs to be changed to
> '/^\s*(create|alter|truncate|drop|set)\s/i'. In Wordpress 4.0.1, this is
> on line 1596 of wp-includes/wp-db.php.
New description:
When performing a query, WordPress filters out create, alter, truncate,
drop, insert, delete, update, and replace queries so they don't call
mysqli_fetch_object. These queries return a boolean, not a mysqli_result
object and the call to mysqli_fetch_object gives an invalid argument. Set
queries need to be added to this list.
Specifically, the `'/^\s*(create|alter|truncate|drop)\s/i'` regular
expression needs to be changed to
`'/^\s*(create|alter|truncate|drop|set)\s/i'`. In WordPress 4.0.1, this is
on line 1596 of wp-includes/wp-db.php.
--
--
Ticket URL: <https://core.trac.wordpress.org/ticket/30595#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list