json_encode instead of PHP serialized

This commit is contained in:
Ralf Becker 2014-06-27 08:47:30 +00:00
parent b633df95ec
commit d422d2ea8d

View File

@ -501,8 +501,8 @@ class asyncservice
$jobs = array(); $jobs = array();
foreach($this->db->select($this->db_table,$cols,$where,__LINE__,__FILE__,$offset,$append,False,$num_rows) as $row) foreach($this->db->select($this->db_table,$cols,$where,__LINE__,__FILE__,$offset,$append,False,$num_rows) as $row)
{ {
$row['async_times'] = unserialize($row['async_times']); $row['async_times'] = php_json_unserialize($row['async_times']);
$row['async_data'] = unserialize($row['async_data']); $row['async_data'] = php_json_unserialize($row['async_data']);
$jobs[$row['async_id']] = egw_db::strip_array_keys($row,'async_'); $jobs[$row['async_id']] = egw_db::strip_array_keys($row,'async_');
} }
if (!count($jobs)) if (!count($jobs))
@ -527,9 +527,9 @@ class asyncservice
if (isset($job['data']['next']) && isset($job['next'])) $job['data']['next'] = $job['next']; if (isset($job['data']['next']) && isset($job['next'])) $job['data']['next'] = $job['next'];
$data = array( $data = array(
'async_next' => $job['next'], 'async_next' => $job['next'],
'async_times' => serialize($job['times']), 'async_times' => json_encode($job['times']),
'async_method' => $job['method'], 'async_method' => $job['method'],
'async_data' => serialize($job['data']), 'async_data' => json_encode($job['data']),
'async_account_id'=> $job['account_id'], 'async_account_id'=> $job['account_id'],
); );
if ($exists) if ($exists)