The following warnings occurred: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
|
Quoted Quote Markes and More Slashes - Printable Version +- Form Tools (https://forums.formtools.org) +-- Forum: Form Tools (https://forums.formtools.org/forumdisplay.php?fid=1) +--- Forum: General Discussion (https://forums.formtools.org/forumdisplay.php?fid=5) +--- Thread: Quoted Quote Markes and More Slashes (/showthread.php?tid=2297) |
Quoted Quote Markes and More Slashes - kwhitlock - Nov 17th, 2012 Hi, I seem to have this problem with slash markes that keep doubling up with every update. The first time I view the string in a textarea, it appears just fine: This is a "quote" and this is another 'quote' When I click on update the same string appears as: This a \"quote\" and this is another \'quote' Clicking update again and the backslash doubles and so on and so on. This is a \\"quote\\" and this is another \\'quote \\' Could some one point me to the function() that is applying these backslashes so that I can turn them off? Or something I can add as a hook to fix this? Thanks! Kellie OBTW I am using the lastest and greatest formtools version :-) RE: Quoted Quote Markes and More Slashes - Joe - Nov 20th, 2012 (Nov 17th, 2012, 10:07 PM)kwhitlock Wrote: Hi, Hmmm... this really shouldn't be occurring. I even added the exact example into my local version and the demo and the additional escapes do not occur. MySQL does add escapes: http://dev.mysql.com/doc/refman/5.0/en/string-literals.html Perhaps you can use the Submission Pre-parser to parse the data to prevent additional backslashes from being added: http://modules.formtools.org/submission_pre_parser/ Hope this helps. RE: Quoted Quote Markes and More Slashes - Joe - Nov 30th, 2012 Some very helpful information from kwhitlock regarding the issue above: Since my installation is using the latest release of PHP Version 5.4.3 and MYSQL 5.0.10, the php.ini file setting for get_magic_quotes=On or Off has been deprecated... so the if () never gets executed to strip out the slashes when it fetches the data out of the field. An update of the form, just escapes them again. When I ran this on an older version of php and MySQL where magic_quotes were still around, it works just fine. So some fix is needed or if you can tell me the proper place to insert this php.ini setting, I can try that. I tried putting it under [mysql] and it error'ed the whole application. I might even write a functions that returns true for get_magic_quotes_gpc() and figure out if I can hook it somewhere so I don’t have to modify the build code. Here is where I got the clue about the deprecated function: http://us.php.net/manual/en/function.get-magic-quotes-gpc.php http://answers.yahoo.com/question/index?qid=20091029122628AAFzQJ0 Thanks Kellie!! |