Possible fix for #5470 - json_decode() (#5511)

* Possible fix for #5470:
- $data is not an object like stdClass but an array
- newer PHP versions doesn't allow cross-access like following:

  $object['foo'] = 123;
  $array->foo = 123;

- added type-hints for private methods for above cases
- used `if (empty($foo)) instead of just `if ($foo)` preventing some nasty
  E_NOTICE
- added some empty lines for better readability

* Rewrite:
- mixture of object/array was here, causing under newer PHP versions some E_NOTICE
- this has been now finally fixed by converting any `object` type to an
  associative `array`
- also changed `is_object()` to `is_array()`
pull/5514/head
Roland Häder 2018-07-28 07:35:27 +02:00 zatwierdzone przez Hypolite Petovan
rodzic 4a22710b3b
commit c30ac30f29
1 zmienionych plików z 301 dodań i 250 usunięć