From de8ed36df1582b2e76e7127e683acd0b2535f8f7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=B6rn=20Zaefferer?= Date: Thu, 28 Jan 2010 13:27:32 +0000 Subject: [PATCH] autocomplete: back to custom json encoding (for compat with older PHP implementations, fixed the double quotes --- demos/autocomplete/search.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/demos/autocomplete/search.php b/demos/autocomplete/search.php index af490522e..4644caf5c 100644 --- a/demos/autocomplete/search.php +++ b/demos/autocomplete/search.php @@ -588,13 +588,13 @@ function array_to_json( $array ){ if( is_numeric($key) ){ $key = "key_$key"; } - $key = "'".addslashes($key)."'"; + $key = "\"".addslashes($key)."\""; // Format the value: if( is_array( $value )){ $value = array_to_json( $value ); } else if( !is_numeric( $value ) || is_string( $value ) ){ - $value = "'".addslashes($value)."'"; + $value = "\"".addslashes($value)."\""; } // Add to staging array: -- 2.39.5