From ce6de601e3d8b996cf125221249ffe4fcf628d9c Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Thu, 26 Jun 2014 18:23:51 +0000 Subject: [PATCH] `absint()` should always return `PHP_INT_MAX` if the resulting value exceeds it. See [28855]. Fixes #23383. git-svn-id: https://develop.svn.wordpress.org/trunk@28856 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/functions.php | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/wp-includes/functions.php b/src/wp-includes/functions.php index 7714c72218..ade32740be 100644 --- a/src/wp-includes/functions.php +++ b/src/wp-includes/functions.php @@ -3000,15 +3000,10 @@ function dead_db() { * @since 2.5.0 * * @param mixed $maybeint Data you wish to have converted to a nonnegative integer - * @param bool $limit Whether to only return up to PHP_INT_MAX. * @return int An nonnegative integer */ -function absint( $maybeint, $limit = false ) { - $int = abs( intval( $maybeint ) ); - if ( $limit && $int > PHP_INT_MAX ) { - $int = PHP_INT_MAX; - } - return $int; +function absint( $maybeint ) { + return min( abs( (int) $maybeint ), PHP_INT_MAX ); } /**