[wp-trac] [WordPress Trac] #11112: get_term() does not verify for valid output from wpdb::get_row()
WordPress Trac
wp-trac at lists.automattic.com
Tue Nov 10 14:49:24 UTC 2009
#11112: get_term() does not verify for valid output from wpdb::get_row()
--------------------------+-------------------------------------------------
Reporter: johncoswell | Owner: filosofo
Type: defect (bug) | Status: new
Priority: low | Milestone: Unassigned
Component: Taxonomy | Version: 2.9
Severity: minor | Keywords: reporter-feedback
--------------------------+-------------------------------------------------
Comment(by johncoswell):
The error message: get_object_vars() expects parameter 1 to be object,
null given in wp-includes\taxonomy.php on line 335
The function get_category() is being called with $object set to ARRAY_A.
If the requested category ID that is passed to get_category(), which is
subsequently passed to wpdb::get_row(), does not exist in the database, or
some other failure occurs within wpdb::get_row(), wpdb::get_row() can
return a non-object value such as null. When the code falls through to the
section returning the output, and ARRAY_A or ARRAY_N is provided as
$object, this non-object value will be passed to get_object_vars(),
raising the warning. This warning is not raised in any other state for
$object, as those cause $_term to be returned untouched.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/11112#comment:2>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list