[wp-trac] [WordPress Trac] #3240: stripslashes in update_usermeta
messes up meta_values for arrays/objects
WordPress Trac
wp-trac at lists.automattic.com
Fri Oct 13 23:12:40 GMT 2006
#3240: stripslashes in update_usermeta messes up meta_values for arrays/objects
----------------------------+-----------------------------------------------
Reporter: stm | Owner: anonymous
Type: defect | Status: new
Priority: normal | Milestone:
Component: Administration | Version:
Severity: normal | Keywords: bug serialize
----------------------------+-----------------------------------------------
the change made in rev [4382] caused a problem when trying to set a non-
string as a meta_value.
There should be a check made to see if the object is a string before doing
a stripslashes.
ie.
{{{
if ( !is_array($meta_value) && !is_object($meta_value) )
$meta_value = stripslashes($meta_value);
}}}
I found this because it was making the Administrator capabilites be
'Array' in the db instead of the serialized array of capabilities it was
supposed to be set to.
--
Ticket URL: <http://trac.wordpress.org/ticket/3240>
WordPress Trac <http://wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list