Fix illegal string offset in spyc component

This commit is contained in:
Loz Calver 2017-04-03 21:33:33 +01:00 committed by Sam Minnee
parent cca7e9697c
commit 82f62c8184
1 changed files with 2 additions and 1 deletions

View File

@ -769,7 +769,8 @@ class Spyc {
$_arr = array_merge ($_arr, $value);
} else if ($key || $key === '') {
$_arr[$key] = $value;
if (!is_array ($_arr)) { $_arr = array ($key=>$value); }
else { $_arr[$key] = $value; }
} else {
if (!is_array ($_arr)) { $_arr = array ($value); $key = 0; }
else { $_arr[] = $value; end ($_arr); $key = key ($_arr); }