PHP - cannot use a scalar as an array warning

generate an error :  cannot use a scalar as an array warning (even on php V7)
This commit is contained in:
This Charlène 2022-07-20 11:10:54 +02:00 committed by GitHub
parent 7316210df6
commit 2c898b45e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -69,7 +69,7 @@ if ($id > 0 || $ref) {
$object->fetch($id, $ref);
}
$selectedvariant = !empty($_SESSION['addvariant_'.$object->id]) ? $_SESSION['addvariant_'.$object->id] : 0;
$selectedvariant = !empty($_SESSION['addvariant_'.$object->id]) ? $_SESSION['addvariant_'.$object->id] : Array();
// Security check
if (empty($conf->variants->enabled)) {