diff --git a/wbce/framework/functions.php b/wbce/framework/functions.php index 0b616fc7e..e569a06a2 100644 --- a/wbce/framework/functions.php +++ b/wbce/framework/functions.php @@ -1267,4 +1267,22 @@ function url_encode($string) $replacements = array('!', '*', "'", "(", ")", ";", ":", "@", "&", "=", "+", "$", ",", "/", "?", "%", "#", "[", "]"); return str_replace($entities, $replacements, rawurlencode($string)); } -} \ No newline at end of file +} + + +/** + * is_countable() + * ============== + * This function will be implemented in PHP since version 7.3.0 + * This polyfill function will allow the use of this function + * also on environments with a PHP lower than 7.3.0 + * see also: http://php.net/manual/en/function.is-countable.php + * + * @param unspecified $uVar The variable you want to check + * @return bool true or false + */ +if (!function_exists('is_countable')) { + function is_countable($uVar) { + return (is_array($uVar) || $uVar instanceof Countable); + } +}