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 Laurent Destailleur
parent a02c0f55fb
commit 69626875fc

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)) {