From: Michael M Slusarz Date: Fri, 21 Jan 2011 23:39:48 +0000 (-0700) Subject: json_decode() returns null on error, not false X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=f5abccfc3a3d9826fb6dd03511afce3ab4907f8f;p=horde.git json_decode() returns null on error, not false --- diff --git a/framework/Serialize/lib/Horde/Serialize.php b/framework/Serialize/lib/Horde/Serialize.php index 3130b2847..39e85ac87 100644 --- a/framework/Serialize/lib/Horde/Serialize.php +++ b/framework/Serialize/lib/Horde/Serialize.php @@ -355,7 +355,10 @@ class Horde_Serialize break; case self::JSON: - $data = json_decode($data); + $out = json_decode($data); + if (!is_null($out) || (strcasecmp($data, 'null') === 0)) { + return $out; + } break; case self::LZF: