From 4c15c2f2de9ed51aa6f7ef88b3a9b6001a234340 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Wed, 2 Jul 2014 12:42:12 +0000 Subject: [PATCH] * Calendar/API: allow not serialized data in async jobs, only run automatic purge if we have a real number > 0 --- calendar/inc/class.calendar_boupdate.inc.php | 5 ++++- phpgwapi/inc/class.asyncservice.inc.php | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/calendar/inc/class.calendar_boupdate.inc.php b/calendar/inc/class.calendar_boupdate.inc.php index 1765d74795..4568f5007e 100644 --- a/calendar/inc/class.calendar_boupdate.inc.php +++ b/calendar/inc/class.calendar_boupdate.inc.php @@ -2685,6 +2685,9 @@ class calendar_boupdate extends calendar_bo */ function purge($age) { - $this->so->purge(time() - 365*24*3600*(float)$age); + if (is_numeric($age) && $age > 0) // just make sure bogus values dont delete everything + { + $this->so->purge(time() - 365*24*3600*(float)$age); + } } } diff --git a/phpgwapi/inc/class.asyncservice.inc.php b/phpgwapi/inc/class.asyncservice.inc.php index d4d207c83a..bbcfe774a3 100644 --- a/phpgwapi/inc/class.asyncservice.inc.php +++ b/phpgwapi/inc/class.asyncservice.inc.php @@ -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))