From 5b705ea4c842140c94639c6194f8baf47110d08c Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Fri, 31 Jul 2009 11:35:10 -0600 Subject: [PATCH] Fix urlencoding in escapeJson() --- framework/Core/lib/Horde.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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) . '\''; } /** -- 2.11.0