git-svn-id: http://svn.automattic.com/wordpress/trunk@19596 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
429faf564a
commit
340e93324c
@ -487,10 +487,15 @@ class WP_User {
|
||||
static function get_data_by( $field, $value ) {
|
||||
global $wpdb;
|
||||
|
||||
if ( 'id' == $field )
|
||||
if ( 'id' == $field ) {
|
||||
// Make sure the value is numeric to avoid casting objects, for example,
|
||||
// to int 1.
|
||||
if ( ! is_numeric( $value ) )
|
||||
return false;
|
||||
$value = absint( $value );
|
||||
else
|
||||
} else {
|
||||
$value = trim( $value );
|
||||
}
|
||||
|
||||
if ( !$value )
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user