On Tue, Jul 15, 2008 at 7:59 AM, Derrell Lipman <
[EMAIL PROTECTED]> wrote:

>
> I'll also compare the PHP parser that we're using against the latest from
> json.org to see what has changed.
>

Would you please try the attached patch and let me know if it fixes the
problem.

Derrell
diff --git a/qooxdoo/backend/php/services/JSON.phps b/qooxdoo/backend/php/services/JSON.phps
index 8945f3d..ea9d546 100644
--- a/qooxdoo/backend/php/services/JSON.phps
+++ b/qooxdoo/backend/php/services/JSON.phps
@@ -715,9 +715,10 @@ class JSON
 
                         } elseif (($chrs{$c} == $top['delim']) &&
                                  ($top['what'] == SERVICES_JSON_IN_STR) &&
-                                 (($chrs{$c - 1} != '\\') ||
-                                 ($chrs{$c - 1} == '\\' && $chrs{$c - 2} == '\\'))) {
+                                 ((strlen(substr($chrs, 0, $c)) - strlen(rtrim(substr($chrs, 0, $c), '\\'))) % 2 != 1)) {
                             // found a quote, we're in a string, and it's not escaped
+                            // we know that it's not escaped becase there is _not_ an
+                            // odd number of backslashes at the end of the string so far
                             array_pop($stk);
                             //print("Found end of string at {$c}: ".substr($chrs, $top['where'], (1 + 1 + $c - $top['where']))."\n");
 
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to