Zeruell / ppx-raidplaner

Automatically exported from code.google.com/p/ppx-raidplaner
0 stars 0 forks source link

JSON error : bad escaped character #76

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. use a ' (and maybe " or utf8 characters) in your comment

What version of the product are you using? Which browser / php version are
you using?

1.0.0

Please provide any additional information below.

SyntaxError: JSON.parse: bad escaped character

The XHR answer (problem is in the very last comment):

{"startDay":30,"startMonth":9,"startYear":2013,"startOfWeek":1,"displayMonth":10
,"displayYear":2013,"raid":[{"id":2,"location":"Instance 
Héroïque","stage":"locked","size":5,"startDate":"2013-09-30","start":"
18:30","endDate":"2013-09-30","end":"22:00","image":"dungeon5.png","description"
:"","status":"unavailable","attendanceIndex":-1,"comment":"","role":2,"role0Slot
s":1,"role0":2,"role1Slots":1,"role1":1,"role2Slots":3,"role2":5},{"id":3,"locat
ion":"Zul'Aman","stage":"locked","size":10,"startDate":"2013-09-30","start":
"18:30","endDate":"2013-09-30","end":"22:00","image":"za.png","description":"Nou
velle ID, 4 
timers","status":"unavailable","attendanceIndex":-1,"comment":"","role":0,"role0
Slots":2,"role0":2,"role1Slots":2,"role1":2,"role2Slots":6,"role2":8},{"id":4,"l
ocation":"Instance 
Héroïque","stage":"locked","size":5,"startDate":"2013-10-01","start":"
18:30","endDate":"2013-10-01","end":"22:00","image":"dungeon5.png","description"
:"","status":"available","attendanceIndex":12,"comment":"","role":2,"role0Slots"
:1,"role0":1,"role1Slots":1,"role1":1,"role2Slots":3,"role2":4},{"id":5,"locatio
n":"Raid 
10","stage":"locked","size":10,"startDate":"2013-10-02","start":"18:30","endDate
":"2013-10-02","end":"22:00","image":"raid10.png","description":"Destination 
à 
définir","status":"unavailable","attendanceIndex":-1,"comment":"","role":0,
"role0Slots":2,"role0":1,"role1Slots":2,"role1":1,"role2Slots":6,"role2":7},{"id
":6,"location":"Instance 
Héroïque","stage":"locked","size":5,"startDate":"2013-10-02","start":"
18:30","endDate":"2013-10-02","end":"22:00","image":"dungeon5.png","description"
:"Instance à définir - farm réput des 
nouveaux","status":"unavailable","attendanceIndex":-1,"comment":"","role":0,"rol
e0Slots":1,"role0":1,"role1Slots":1,"role1":1,"role2Slots":3,"role2":1},{"id":7,
"location":"Instance 
Héroïque","stage":"locked","size":5,"startDate":"2013-10-03","start":"
18:30","endDate":"2013-10-03","end":"22:00","image":"dungeon5.png","description"
:"","status":"available","attendanceIndex":12,"comment":"","role":2,"role0Slots"
:1,"role0":1,"role1Slots":1,"role1":1,"role2Slots":3,"role2":3},{"id":8,"locatio
n":"Raid 
10","stage":"locked","size":10,"startDate":"2013-10-03","start":"18:30","endDate
":"2013-10-03","end":"22:00","image":"raid10.png","description":"","status":"ok"
,"attendanceIndex":12,"comment":"","role":2,"role0Slots":2,"role0":1,"role1Slots
":2,"role1":1,"role2Slots":6,"role2":5},{"id":9,"location":"Instance 
Héroïque","stage":"locked","size":5,"startDate":"2013-10-04","start":"
18:30","endDate":"2013-10-04","end":"22:00","image":"dungeon5.png","description"
:"","status":"unavailable","attendanceIndex":-1,"comment":"","role":0,"role0Slot
s":1,"role0":0,"role1Slots":1,"role1":1,"role2Slots":3,"role2":1},{"id":10,"loca
tion":"Instance 
Héroïque","stage":"locked","size":5,"startDate":"2013-10-05","start":"
18:30","endDate":"2013-10-05","end":"22:00","image":"dungeon5.png","description"
:"","status":"unavailable","attendanceIndex":-1,"comment":"","role":0,"role0Slot
s":1,"role0":0,"role1Slots":1,"role1":0,"role2Slots":3,"role2":1},{"id":11,"loca
tion":"Zul'Aman","stage":"locked","size":10,"startDate":"2013-10-06","start"
:"18:30","endDate":"2013-10-06","end":"22:00","image":"za.png","description":"",
"status":"ok","attendanceIndex":12,"comment":"","role":2,"role0Slots":2,"role0":
1,"role1Slots":2,"role1":1,"role2Slots":6,"role2":6},{"id":12,"location":"Instan
ce 
Héroïque","stage":"locked","size":5,"startDate":"2013-10-07","start":"
18:30","endDate":"2013-10-07","end":"22:00","image":"dungeon5.png","description"
:"","status":"unavailable","attendanceIndex":-1,"comment":"","role":0,"role0Slot
s":1,"role0":0,"role1Slots":1,"role1":1,"role2Slots":3,"role2":0},{"id":13,"loca
tion":"Zul'Aman","stage":"locked","size":10,"startDate":"2013-10-08","start"
:"18:30","endDate":"2013-10-08","end":"22:00","image":"za.png","description":"",
"status":"ok","attendanceIndex":12,"comment":"","role":2,"role0Slots":2,"role0":
1,"role1Slots":2,"role1":1,"role2Slots":6,"role2":5},{"id":14,"location":"Instan
ce 
Héroïque","stage":"locked","size":5,"startDate":"2013-10-09","start":"
18:30","endDate":"2013-10-09","end":"22:00","image":"dungeon5.png","description"
:"","status":"unavailable","attendanceIndex":-1,"comment":"","role":0,"role0Slot
s":1,"role0":1,"role1Slots":1,"role1":1,"role2Slots":3,"role2":0},{"id":15,"loca
tion":"Raid 
10","stage":"locked","size":10,"startDate":"2013-10-10","start":"18:30","endDate
":"2013-10-10","end":"22:00","image":"raid10.png","description":"","status":"ok"
,"attendanceIndex":12,"comment":"","role":2,"role0Slots":2,"role0":1,"role1Slots
":2,"role1":0,"role2Slots":6,"role2":3},{"id":16,"location":"Zul'Aman","stag
e":"locked","size":10,"startDate":"2013-10-11","start":"18:30","endDate":"2013-1
0-11","end":"22:00","image":"za.png","description":"","status":"notset","attenda
nceIndex":0,"comment":"","role":"","role0Slots":2,"role0":1,"role1Slots":2,"role
1":1,"role2Slots":6,"role2":2},{"id":18,"location":"Instance 
Héroïque","stage":"locked","size":5,"startDate":"2013-10-11","start":"
18:30","endDate":"2013-10-11","end":"22:00","image":"dungeon5.png","description"
:"","status":"notset","attendanceIndex":0,"comment":"","role":"","role0Slots":1,
"role0":1,"role1Slots":1,"role1":1,"role2Slots":3,"role2":0},{"id":17,"location"
:"Zul'Aman","stage":"locked","size":10,"startDate":"2013-10-12","start":"18:
30","endDate":"2013-10-12","end":"22:00","image":"za.png","description":"","stat
us":"notset","attendanceIndex":0,"comment":"","role":"","role0Slots":2,"role0":0
,"role1Slots":2,"role1":1,"role2Slots":6,"role2":1},{"id":19,"location":"Instanc
e 
Héroïque","stage":"locked","size":5,"startDate":"2013-10-12","start":"
18:30","endDate":"2013-10-12","end":"22:00","image":"dungeon5.png","description"
:"","status":"notset","attendanceIndex":0,"comment":"","role":"","role0Slots":1,
"role0":0,"role1Slots":1,"role1":1,"role2Slots":3,"role2":0},{"id":20,"location"
:"Instance 
Héroïque","stage":"locked","size":5,"startDate":"2013-10-17","start":"
18:30","endDate":"2013-10-17","end":"22:00","image":"dungeon5.png","description"
:"","status":"notset","attendanceIndex":0,"comment":"","role":"","role0Slots":1,
"role0":0,"role1Slots":1,"role1":1,"role2Slots":3,"role2":0},{"id":21,"location"
:"Zul'Aman","stage":"locked","size":10,"startDate":"2013-10-18","start":"18:
30","endDate":"2013-10-18","end":"22:00","image":"za.png","description":"","stat
us":"notset","attendanceIndex":0,"comment":"","role":"","role0Slots":2,"role0":1
,"role1Slots":2,"role1":1,"role2Slots":6,"role2":1},{"id":28,"location":"Instanc
e 
Héroïque","stage":"open","size":25,"startDate":"2013-10-30","start":"1
9:30","endDate":"2013-10-30","end":"23:00","image":"dungeon5.png","description":
"test","status":"available","attendanceIndex":12,"comment":"pas l\'ordi ce 
soir 
la","role":2,"role0Slots":2,"role0":0,"role1Slots":6,"role1":1,"role2Slots":17,"
role2":1}]}

Original issue reported on code.google.com by athenebl...@gmail.com on 23 Oct 2013 at 10:48

GoogleCodeExporter commented 9 years ago

Original comment by arne.cl...@gmail.com on 24 Oct 2013 at 8:38

GoogleCodeExporter commented 9 years ago
I need your server's PHP version to properly reproduce this

It looks like this is a php version specific problem.  I cannot reproduce here 
and code stripping the "\" leading to the error is already in place, too.

Original comment by arne.cl...@gmail.com on 24 Oct 2013 at 11:23

GoogleCodeExporter commented 9 years ago
Ok - I need one more detail.
Do your know how the comment was entered?

- The player chose "I'm absent" and entered a text
- The player added a comment after/before signing up as available

Oh - and to get your calendar back to work open phpMyAdmin, go to the table 
raids_Attendance, look for RaidId 28 (and the specific comment) and remove the 
"\" after the "l" => "pas l'ordi ce soir la".
That should do the trick.

Original comment by arne.cl...@gmail.com on 24 Oct 2013 at 11:46

GoogleCodeExporter commented 9 years ago
The attached file might fix a possible cause for the problem.
This would cover the case where a player entered a dialog *during* attend.
The standard case for this would be choosing "I'm absent" and entering a text.

As I still cannot reproduce the bug here I cannot say if this fixes the actual 
problem (still need the PHP version).

Original comment by arne.cl...@gmail.com on 24 Oct 2013 at 11:53

Attachments:

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
php version is: 5.2.17-0.dotdeb.0

the player chose "i'm absent" on the calendar page and entered a comment with a 
' .

When adding the same comment whith the yellow icon in the rop right corner I 
don't get the error, it's only with the absent comment popup

Your Fix works

Original comment by athenebl...@gmail.com on 25 Oct 2013 at 9:39

GoogleCodeExporter commented 9 years ago
Perfect :)

Original comment by arne.cl...@gmail.com on 25 Oct 2013 at 2:10

GoogleCodeExporter commented 9 years ago

Original comment by arne.cl...@gmail.com on 26 Oct 2013 at 7:25