Make WordPress Core

Ticket #23383: 23383.diff

File 23383.diff, 689 bytes (added by wonderboymusic, 10 years ago)
  • src/wp-includes/functions.php

     
    29942994 * @since 2.5.0
    29952995 *
    29962996 * @param mixed $maybeint Data you wish to have converted to a nonnegative integer
     2997 * @param bool $limit Whether to only return up to PHP_MAX_INT.
    29972998 * @return int An nonnegative integer
    29982999 */
    2999 function absint( $maybeint ) {
    3000         return abs( intval( $maybeint ) );
     3000function absint( $maybeint, $limit = false ) {
     3001        $int = abs( intval( $maybeint ) );
     3002        if ( $limit && $int > PHP_INT_MAX ) {
     3003                $int = PHP_INT_MAX;
     3004        }
     3005        return $int;
    30013006}
    30023007
    30033008/**