Skip to content
Snippets Groups Projects
Commit 02e53c51 authored by Prasad's avatar Prasad
Browse files

Fixed php7_count return value compat

parent a636669f
No related branches found
No related tags found
No related merge requests found
......@@ -962,8 +962,10 @@ if (!function_exists('get_magic_quotes_gpc')) {
}
function php7_count($value) {
// PHP 8.x does not like count(null) or count(string)
return is_null($value) || !is_array($value) ? 0 : count($value);
// PHP 8.x does not allow count(null) or count(string)
if (is_null($value)) return 0;
if (!is_array($value)) return 1;
return count($value);
}
?>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment