From: Michael M Slusarz Date: Wed, 24 Nov 2010 21:44:16 +0000 (-0700) Subject: JSON encode prefs scope object when serializing. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=dd8c280eca44d95378f91118fce54025dd32077f;p=horde.git JSON encode prefs scope object when serializing. Another advantage of requiring UTF-8 input to prefs - JSON encoding provides ~12% storage advantage (in my limited testing) over serialize(). --- diff --git a/framework/Prefs/lib/Horde/Prefs/Scope.php b/framework/Prefs/lib/Horde/Prefs/Scope.php index 0bf1c2756..8a9359fd1 100644 --- a/framework/Prefs/lib/Horde/Prefs/Scope.php +++ b/framework/Prefs/lib/Horde/Prefs/Scope.php @@ -255,7 +255,7 @@ class Horde_Prefs_Scope implements Serializable */ public function serialize() { - return serialize(array( + return json_encode(array( $this->scope, $this->_prefs )); @@ -265,7 +265,7 @@ class Horde_Prefs_Scope implements Serializable */ public function unserialize($data) { - list($this->scope, $this->_prefs) = unserialize($data); + list($this->scope, $this->_prefs) = json_decode($data, true); } }