* Calendar/API: allow not serialized data in async jobs, only run automatic purge if we have a real number > 0

This commit is contained in:
Ralf Becker 2014-07-02 12:42:12 +00:00
parent ff9443acff
commit 4c15c2f2de
2 changed files with 5 additions and 2 deletions

View File

@ -2684,7 +2684,10 @@ class calendar_boupdate extends calendar_bo
* @param int|float $age How many years old the event must be before it is deleted
*/
function purge($age)
{
if (is_numeric($age) && $age > 0) // just make sure bogus values dont delete everything
{
$this->so->purge(time() - 365*24*3600*(float)$age);
}
}
}

View File

@ -502,7 +502,7 @@ class asyncservice
foreach($this->db->select($this->db_table,$cols,$where,__LINE__,__FILE__,$offset,$append,False,$num_rows) as $row)
{
$row['async_times'] = json_php_unserialize($row['async_times']);
$row['async_data'] = json_php_unserialize($row['async_data']);
$row['async_data'] = json_php_unserialize($row['async_data'], true); // allow non-serialized data
$jobs[$row['async_id']] = egw_db::strip_array_keys($row,'async_');
}
if (!count($jobs))