1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-02-11 19:24:10 +01:00

Merge pull request #6301 from marc1706/ticket/16883

[ticket/16883] Check if var is array before using count()
This commit is contained in:
Máté Bartus 2021-10-06 08:39:40 +02:00 committed by GitHub
commit 59cece1a0a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -168,8 +168,14 @@ class diff
$final = $edit->final;
// We can simplify one case where the array is usually supposed to be empty...
if (count($orig) == 1 && trim($orig[0]) === '') $orig = array();
if (count($final) == 1 && trim($final[0]) === '') $final = array();
if (is_array($orig) && count($orig) == 1 && trim($orig[0]) === '')
{
$orig = array();
}
if (is_array($final) && count($final) == 1 && trim($final[0]) === '')
{
$final = array();
}
if (!$orig && !$final)
{