Make WordPress Core


Ignore:
Timestamp:
03/08/2016 05:14:52 PM (8 years ago)
Author:
ocean90
Message:

Update Random_Compat from 1.1.6 to 1.2.1.

Changes: https://github.com/paragonie/random_compat/compare/1.1.6...v1.2.1

See #35665.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/random_compat/cast_to_int.php

    r35365 r36886  
    3838     * through.
    3939     *
    40      * @param numeric $number The number we want to convert to an int
    41      * @param boolean $fail_open Set to true to not throw an exception
     40     * @param int|float $number    The number we want to convert to an int
     41     * @param boolean   $fail_open Set to true to not throw an exception
    4242     *
    4343     * @return int (or float if $fail_open)
     44     *
     45     * @throws TypeError
    4446     */
    4547    function RandomCompat_intval($number, $fail_open = false)
     
    4850            $number += 0;
    4951        }
     52
    5053        if (
    51             is_float($number) &&
    52             $number > ~PHP_INT_MAX &&
     54            is_float($number)
     55            &&
     56            $number > ~PHP_INT_MAX
     57            &&
    5358            $number < PHP_INT_MAX
    5459        ) {
    5560            $number = (int) $number;
    5661        }
     62
    5763        if (is_int($number) || $fail_open) {
    5864            return $number;
    5965        }
     66
    6067        throw new TypeError(
    6168            'Expected an integer.'
Note: See TracChangeset for help on using the changeset viewer.