mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 04:18:52 +00:00
[ticket/16883] Check if var is array before using count()
PHPBB3-16883
This commit is contained in:
parent
9a7d88362f
commit
e5fa23c3c0
1 changed files with 8 additions and 2 deletions
|
@ -168,8 +168,14 @@ class diff
|
||||||
$final = $edit->final;
|
$final = $edit->final;
|
||||||
|
|
||||||
// We can simplify one case where the array is usually supposed to be empty...
|
// We can simplify one case where the array is usually supposed to be empty...
|
||||||
if (count($orig) == 1 && trim($orig[0]) === '') $orig = array();
|
if (is_array($orig) && count($orig) == 1 && trim($orig[0]) === '')
|
||||||
if (count($final) == 1 && trim($final[0]) === '') $final = array();
|
{
|
||||||
|
$orig = array();
|
||||||
|
}
|
||||||
|
if (is_array($final) && count($final) == 1 && trim($final[0]) === '')
|
||||||
|
{
|
||||||
|
$final = array();
|
||||||
|
}
|
||||||
|
|
||||||
if (!$orig && !$final)
|
if (!$orig && !$final)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue