Ticket #5601 (closed bug: invalid)
1.4a1 causing parserror using form.js
| Reported by: | charlietfl | Owned by: | |
|---|---|---|---|
| Priority: | major | Milestone: | 1.4 |
| Component: | plugin | Version: | 1.4a1 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
tried 1.4a1 in an app have been working on for a month with 1.3.2
immediately got an error haven't had coming from malsup form.js
'parserror' on an ajax submit with json. Firebug and json lint both validate the json
revert back and forth between 1.3.2 and 1.4a1 and error is consistent only in 1.4a1
Change History
comment:1 Changed 4 years ago by dmethvin
- Status changed from new to closed
- Resolution set to invalid
comment:2 Changed 4 years ago by alec
- Status changed from closed to reopened
- Resolution invalid deleted
The same regression in Roundcube Webmail. I have no testcase, but I've investigated it more. In httpData() json response is interpreted with:
data = (new Function("return " + data))();
while in 1.3.2 eval was used. Changing this to old:
data = window["eval"]("(" + data + ")");
fixes issue. If I add alert(data) before this line, I got example response wich causes "invalid label" error in Firefox. This is the alert message:
/** ajax response [08/Dec/2009 11:43:31 +0100] **/
{action:'getunread',unlock:0,exec:'this.set_unread_count(\'Spam\',123,0);\nthis.set_unread_count(\'&BCAEMARBBEEESwQ7BDoEOA-\',2,0);\n'}
Again, it works with 1.3.2.
comment:3 Changed 4 years ago by dmethvin
Actually, alec, that's good info. It looks to me like the json being passed is malformed. The property names aren't quoted and the strings are being quoted with single quotes. Neither is allowed in syntactically proper json.
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

Please reopen with a test case.