]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/random_compat/random_int.php
WordPress 4.7
[autoinstalls/wordpress.git] / wp-includes / random_compat / random_int.php
index 6c91dbc516d06b67717667838fb561c2c030b9d1..fd3ef87a22381bb11b8cef5f41138f33d88cdd21 100644 (file)
@@ -55,6 +55,7 @@ function random_int($min, $max)
             'random_int(): $min must be an integer'
         );
     }
+
     try {
         $max = RandomCompat_intval($max);
     } catch (TypeError $ex) {
@@ -73,6 +74,7 @@ function random_int($min, $max)
             'Minimum value must be less than or equal to the maximum value'
         );
     }
+
     if ($max === $min) {
         return $min;
     }
@@ -98,6 +100,7 @@ function random_int($min, $max)
      * Test for integer overflow:
      */
     if (!is_int($range)) {
+
         /**
          * Still safely calculate wider ranges.
          * Provided by @CodesInChaos, @oittaa
@@ -111,7 +114,9 @@ function random_int($min, $max)
          */
         $bytes = PHP_INT_SIZE;
         $mask = ~0;
+
     } else {
+
         /**
          * $bits is effectively ceil(log($range, 2)) without dealing with 
          * type juggling
@@ -181,5 +186,6 @@ function random_int($min, $max)
          * then try again.
          */
     } while (!is_int($val) || $val > $max || $val < $min);
+
     return (int) $val;
 }