Merging json user find search into cbv live (244:245)
Showing
1 changed file
with
5 additions
and
1 deletions
| ... | @@ -179,7 +179,11 @@ class UserSearch implements ArrayAccess, Iterator, Countable { | ... | @@ -179,7 +179,11 @@ class UserSearch implements ArrayAccess, Iterator, Countable { |
| 179 | } | 179 | } |
| 180 | 180 | ||
| 181 | list($user_id, $user_string) = mysql_fetch_row($this->result); | 181 | list($user_id, $user_string) = mysql_fetch_row($this->result); |
| 182 | $data = array_merge(array_map(function() { return ''; }, array_flip($this->fields)), json_decode($user_string, true)); | 182 | $json_data = json_decode($user_string, true); |
| 183 | if (json_last_error() != JSON_ERROR_NONE) { | ||
| 184 | return false; | ||
| 185 | } | ||
| 186 | $data = array_merge(array_map(function() { return ''; }, array_flip($this->fields)), $json_data); | ||
| 183 | foreach ($data as $key => &$val) { | 187 | foreach ($data as $key => &$val) { |
| 184 | $val = maybe_unserialize($val); | 188 | $val = maybe_unserialize($val); |
| 185 | } | 189 | } | ... | ... |
-
Please register or sign in to post a comment