JSON decode нужен массивами, а не объектами

Хотя проблема, честно, странная. Согласно инструкции должно по-умолчанию отдавать массивами, а у нас поведение отличное.
This commit is contained in:
Exile 2014-12-02 10:44:29 +03:00
commit f8d0238f5b
2 changed files with 2 additions and 2 deletions

View file

@ -5,7 +5,7 @@ if (!defined('IN_AJAX')) die(basename(__FILE__));
global $bf, $lang; global $bf, $lang;
$user_id = (int) $this->request['user_id']; $user_id = (int) $this->request['user_id'];
$new_opt = Zend\Json\Json::decode($this->request['user_opt']); $new_opt = Zend\Json\Json::decode($this->request['user_opt'], Zend\Json\Json::TYPE_ARRAY);
if (!$user_id OR !$u_data = get_userdata($user_id)) if (!$user_id OR !$u_data = get_userdata($user_id))
{ {

View file

@ -671,7 +671,7 @@ class user_common
} }
else if (!empty($_COOKIE['opt_js'])) else if (!empty($_COOKIE['opt_js']))
{ {
$opt_js = Zend\Json\Json::decode($_COOKIE['opt_js']); $opt_js = Zend\Json\Json::decode($_COOKIE['opt_js'], Zend\Json\Json::TYPE_ARRAY);
if (is_array($opt_js)) if (is_array($opt_js))
{ {