saenik / jquery-datatables-editable

Automatically exported from code.google.com/p/jquery-datatables-editable
0 stars 0 forks source link

mangled url in edit text box #72

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Add a new task, add this into a text box: 
Goto <a href=\"http://www.google.com\"> Google</a>

2. json of the aaData is OK: i.e.   "Goto <a href=\\\"http:/...gle.com\\\"> 
Google</a>"

3. Edit in the place, the above text, or just click the link
and it'll produce some extra chars that will mess up the url i.e.
Goto <a href="%5C%5C%5C%22http://www.google.com%5C%5C%5C%22"> Google</a>

The above link is now mangled:
http://my.site.com/mydir/%5C%5C%5C%22http://www.google.com%5C%5C%5C%22

What is the expected output? What do you see instead?
I'm expecting nothing to change if I didn't edit it i.e. it should be as in #1:
Goto <a href=\"http://www.google.com\"> Google</a>

Thanks.

Original issue reported on code.google.com by yfn...@gmail.com on 20 Oct 2011 at 10:36

GoogleCodeExporter commented 9 years ago
The problem was coming from the server PHP which natively added slashes. 
use stripslashes on the POST/GET/REQUEST variable:
http://php.net/manual/en/function.stripslashes.php

e.g.
$value = stripslashes($_POST['value']);
$value = mysql_real_escape_string($value);

Please close this issue.

Original comment by yfn...@gmail.com on 21 Oct 2011 at 6:38

GoogleCodeExporter commented 9 years ago

Original comment by joc...@gmail.com on 31 Oct 2011 at 12:13