[wp-trac] [WordPress Trac] #28315: update_user_meta() updates user with ID1 if WP_Error is passed as first argument
WordPress Trac
noreply at wordpress.org
Thu May 22 17:51:12 UTC 2014
#28315: update_user_meta() updates user with ID1 if WP_Error is passed as first
argument
--------------------------------+------------------------------
Reporter: javorszky | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Options, Meta APIs | Version: 3.9.1
Severity: normal | Resolution:
Keywords: | Focuses:
--------------------------------+------------------------------
Comment (by kitchin):
The fix seems obscure, relying on absint() casting WP_Error differently
than the camparison. Maybe be it should be:
{{{
// Reject $object_id if a WP_Error, other non-scalar, or empty.
if ( !is_scalar($object_id) or !$object_id = absint($object_id) )
return false;
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/28315#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list