fix PHP 8.0 error "array_key_exists(): Argument #2 ($array) must be of type array, null given" when creating a category

This commit is contained in:
Ralf Becker 2021-10-07 16:16:12 +02:00
parent d915b25bba
commit 7c4914d8db

View File

@ -87,7 +87,7 @@ class admin_cmd_category extends admin_cmd
unset($set['old_parent'], $set['base_url'], $set['last_mod'], $set['all_cats'], $set['no_private']); unset($set['old_parent'], $set['base_url'], $set['last_mod'], $set['all_cats'], $set['no_private']);
foreach($set as $key => $value) foreach($set as $key => $value)
{ {
if(array_key_exists($key, $old) && $old[$key] == $value) if ($old && array_key_exists($key, $old) && $old[$key] == $value)
{ {
unset($set[$key]); unset($set[$key]);
unset($old[$key]); unset($old[$key]);