Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Link inside markers description send and invalid JSON error on approval #24

Open
lpdumas opened this issue Jul 31, 2012 · 5 comments
Open
Assignees

Comments

@lpdumas
Copy link
Owner

lpdumas commented Jul 31, 2012

Should we allow links inside the descriptions of a marker?

@ghost ghost assigned jsilvestre Jul 31, 2012
@jsilvestre
Copy link
Collaborator

What is the error message exactly ?

I'm asking because the Validator does not check the translation_data parts so a link inside the marker description should pass the validation.

Give me all the details you have!
Thanks.

@lpdumas
Copy link
Owner Author

lpdumas commented Jul 31, 2012

Paste this in a marker description, and try to send the map for approval. Test

The error message i get:
Ooops
The JSON is invalid: . This can be a bug,do not hesitate to let us know !

On 2012-07-31, at 1:48 PM, Joseph Silvestre wrote:

What is the error message exactly ?

I'm asking because the Validator does not check the translation_data parts so a link inside the marker description should pass the validation.

Give me all the details you have!
Thanks.


Reply to this email directly or view it on GitHub:
#24 (comment)

@jsilvestre
Copy link
Collaborator

Ok I think I know what happened: a link uses <"> for the html tag. JSON too...so during the decoding, PHP does not understand what is given to him and says "json not well formed".

Solution ?

  • adding a backslash in front of the <"> inside the title and desc fields before the submission (client-side).
  • doing the same thing but server-side, before the validation.
    It's just a regular expression so client side or server side...

Actually I am surprised that the JSON.stringify javascript function does not do it automatically (maybe there is a parameter for that ?)

edit: https://developer.mozilla.org/En/Using_native_JSON parameter "replacer" should do the trick ! If we go client-side and I think that's what we should do.

@jsilvestre
Copy link
Collaborator

Have you done anything about it ?

@lpdumas
Copy link
Owner Author

lpdumas commented Aug 9, 2012

Not yet ;)
On Aug 8, 2012 7:46 PM, "Joseph Silvestre" [email protected] wrote:

Have you done anything about it ?


Reply to this email directly or view it on GitHubhttps://github.com//issues/24#issuecomment-7601260.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants