Update WP and plugins

This commit is contained in:
Oliver Davies 2019-04-16 20:56:22 +01:00
parent 10a4713229
commit 1fb77fc4ff
864 changed files with 101724 additions and 78262 deletions

View file

@ -5,7 +5,7 @@
*
* The MIT License (MIT)
*
* Copyright (c) 2015 Paragon Initiative Enterprises
* Copyright (c) 2015 - 2017 Paragon Initiative Enterprises
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@ -26,7 +26,7 @@
* SOFTWARE.
*/
if (!function_exists('RandomCompat_intval')) {
if (!is_callable('RandomCompat_intval')) {
/**
* Cast to an integer if we can, safely.
@ -38,15 +38,18 @@ if (!function_exists('RandomCompat_intval')) {
* through.
*
* @param int|float $number The number we want to convert to an int
* @param boolean $fail_open Set to true to not throw an exception
* @param bool $fail_open Set to true to not throw an exception
*
* @return int (or float if $fail_open)
* @return float|int
* @psalm-suppress InvalidReturnType
*
* @throws TypeError
*/
function RandomCompat_intval($number, $fail_open = false)
{
if (is_numeric($number)) {
if (is_int($number) || is_float($number)) {
$number += 0;
} elseif (is_numeric($number)) {
$number += 0;
}
@ -60,12 +63,13 @@ if (!function_exists('RandomCompat_intval')) {
$number = (int) $number;
}
if (is_int($number) || $fail_open) {
return $number;
if (is_int($number)) {
return (int) $number;
} elseif (!$fail_open) {
throw new TypeError(
'Expected an integer.'
);
}
throw new TypeError(
'Expected an integer.'
);
return $number;
}
}