blackcell Posted May 25, 2010 Share Posted May 25, 2010 I am having an issue with a web based file editor I am creating. The first issue im not too concerned with is the HTML is executed. I tried htmlspecialchars but it didn't make a difference. I am using file_get_contents($file) to pull the contents and then file_put_contents($file,$_POST['txtarea']) to save it. When I save it, there are escape slashes \ all over double quotes and single backslashes and some other stuff. Anybody know which php function is doing it and how to stop this escape routine? Quote Link to comment https://forums.phpfreaks.com/topic/202849-browser-editor-slashes/ Share on other sites More sharing options...
Adam Posted May 25, 2010 Share Posted May 25, 2010 Look into "magic quotes".. Quote Link to comment https://forums.phpfreaks.com/topic/202849-browser-editor-slashes/#findComment-1063053 Share on other sites More sharing options...
blackcell Posted May 25, 2010 Author Share Posted May 25, 2010 Warning This feature has been DEPRECATED as of PHP 5.3.0. Relying on this feature is highly discouraged. But it did help me find stripslashes(). Thanks I think thats what I need. Quote Link to comment https://forums.phpfreaks.com/topic/202849-browser-editor-slashes/#findComment-1063064 Share on other sites More sharing options...
Mchl Posted May 25, 2010 Share Posted May 25, 2010 Yeah. That's because most likely you have magic_quotes enabled. Use get_magic_quotes_gpc to check. Quote Link to comment https://forums.phpfreaks.com/topic/202849-browser-editor-slashes/#findComment-1063069 Share on other sites More sharing options...
blackcell Posted May 25, 2010 Author Share Posted May 25, 2010 Yep. Thats it. Thanks guys. Quote Link to comment https://forums.phpfreaks.com/topic/202849-browser-editor-slashes/#findComment-1063086 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.