Fix backward copat. with cached values serialized but not base64-encoded (#1489142)

pull/88/head
Aleksander Machniak 12 years ago
parent 72c8504b99
commit ab05ee25c1

@ -829,9 +829,14 @@ class rcube_db
*/
public static function decode($input, $serialized = false)
{
if ($serialized) {
// use Base64 encoding to workaround issues with invalid
// or null characters in serialized string (#1489142)
if ($serialized) {
// Keep backward compatybility where base64 wasn't used
if (strpos(substr($input, 0, 16), ':') !== false) {
return self::decode(@unserialize($input));
}
return @unserialize(base64_decode($input));
}

Loading…
Cancel
Save