Skip to content
Permalink
Browse files

autocomplete: back to custom json encoding (for compat with older PHP…

… implementations, fixed the double quotes
  • Loading branch information
jzaefferer committed Jan 28, 2010
1 parent 961238a commit de8ed36df1582b2e76e7127e683acd0b2535f8f7
Showing with 2 additions and 2 deletions.
  1. +2 −2 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:

0 comments on commit de8ed36

Please sign in to comment.
You can’t perform that action at this time.