From df26a7f97ef5730b08658891b3efb3b022ca61d8 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Wed, 22 May 2013 18:14:37 +0000 Subject: [PATCH] In WP_User::get_data_by(), don't abs int negative IDs. Instead, return false when an ID less than 1 is passed. Props nacin, mordauk fixes #23480 git-svn-id: https://develop.svn.wordpress.org/trunk@24316 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/capabilities.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wp-includes/capabilities.php b/wp-includes/capabilities.php index 6a7b021156..4fa6fc3de7 100644 --- a/wp-includes/capabilities.php +++ b/wp-includes/capabilities.php @@ -535,7 +535,9 @@ class WP_User { // to int 1. if ( ! is_numeric( $value ) ) return false; - $value = absint( $value ); + $value = intval( $value ); + if ( $value < 1 ) + return false; } else { $value = trim( $value ); }