From: Michael M Slusarz Date: Fri, 31 Jul 2009 17:35:10 +0000 (-0600) Subject: Fix urlencoding in escapeJson() X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=5b705ea4c842140c94639c6194f8baf47110d08c;p=horde.git Fix urlencoding in escapeJson() --- diff --git a/framework/Core/lib/Horde.php b/framework/Core/lib/Horde.php index d23a260d3..d20745d01 100644 --- a/framework/Core/lib/Horde.php +++ b/framework/Core/lib/Horde.php @@ -628,11 +628,10 @@ HTML; */ static public function escapeJson($data, $options = array()) { - $json = Horde_Serialize::serialize($data, Horde_Serialize::JSON, empty($options['charset']) ? Horde_Nls::getCharset() : $options['charset']); - if (!empty($options['urlencode'])) { - $json = rawurlencode($json); - } - return '/*-secure-' . $json . '*/'; + $json = '/*-secure-' . Horde_Serialize::serialize($data, Horde_Serialize::JSON, empty($options['charset']) ? Horde_Nls::getCharset() : $options['charset']) . '*/'; + return empty($options['urlencode']) + ? $json + : '\'' . rawurlencode($json) . '\''; } /**