From 7ab8e612503680faa0ebb398b187d6574c661aa9 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 25 Jun 2015 20:26:19 +0000 Subject: [PATCH] use json-encoding instead of (php-)serialize for storing of iCal X-properties in DB --- infolog/inc/class.infolog_ical.inc.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/infolog/inc/class.infolog_ical.inc.php b/infolog/inc/class.infolog_ical.inc.php index 7f38456404..a474eb9930 100644 --- a/infolog/inc/class.infolog_ical.inc.php +++ b/infolog/inc/class.infolog_ical.inc.php @@ -401,7 +401,7 @@ class infolog_ical extends infolog_bo { if ($name[2] == ':') { - if ($value[1] == ':' && ($v = unserialize($value)) !== false) $value = $v; + if (($v = json_php_unserialize($value)) && is_array($v)) $value = $v; foreach((array)$value as $compvData) { $comp = Horde_Icalendar::newComponent(substr($name,3), $vevent); @@ -409,7 +409,7 @@ class infolog_ical extends infolog_bo $vevent->addComponent($comp); } } - elseif ($value[1] == ':' && ($attr = unserialize($value)) !== false) + elseif (($attr = json_php_unserialize($value)) && is_array($attr)) { $vevent->setAttribute(substr($name, 2), $attr['value'], $attr['params'], true, $attr['values']); } @@ -866,7 +866,7 @@ class infolog_ical extends infolog_bo $attribute['values']); } $taskData['##'.$attribute['name']] = $attribute['params'] || count($attribute['values']) > 1 ? - serialize($attribute) : $attribute['value']; + json_encode($attribute) : $attribute['value']; break; } }