Menu

#8 Cannot send comma if enclosed in double-quotes

open
nobody
None
5
2006-12-13
2006-12-13
gbelanger
No

Sending a double-quote enclosed string containing one or more commas causes the JSON decoder to ignore the parameter value.

This is due to the fact that the AjaxServer.php strips all slashes BEFORE using the JSON decoder, confusing the decoder into thinking double-quotes inside the string value are actual string delimiters.

The solution, for us, was simply to remove the stripslashes function from AjaxServer.php on line 99:

So:
$request = $json->decode( stripslashes( $this->request[ 'ajax' ] ) );

Became:
$request = $json->decode( $this->request[ 'ajax' ] );

So far, no ill-effects have come from this modification. This bug caused major problems where sending strings contaning HTML, i.e.:

<font face="Arial, Helvetica">

Would break.

Discussion


Log in to post a comment.