-
- 1,024 Posts
Hi,
I have the same problem with one.com, only recently.
It not only changes my documents, but also snippets and chuncks and templates. Bassicaly I can not use Modx with one.com.
Only workaround is that I make everything locally, backup the local database and import it over phpadmin.
Did the code bobray posted work?
Frank.
Simply tell the host they need to set magic_quotes off by default and all will be right with the world. This is deprecated in PHP 5.3, and putting the code back in to handle this will cause E_DEPRECATED errors on servers with PHP 5.3.
-
- 2 Posts
Hello there,
As the actual sysadmin at One.com who’s handled the upgradesm, I can say for sure that it is our policy that magic quotes should be turned off for PHP 5.3. If it is not for your domain then that is an error that should be fixed. Before I start a full scale investigation into why it has been turned on for your domain then I need to know which domain we’re talking about. If you send that to me in a private message then I can promise 2 things; 1) that magic quotes will be turned off ASAP and 2) based upon what I find out about why it is enabled erroneously on your domain then I will personally make sure that it won’t happen again if I have anything to say about it.
Now this thread is a bit old but it was just pointed out to me by someone else.
Sorry for any inconvenience this has caused you but we’ll fix it if it is still an issue, I promise.
Your friendly One.com sysadmin
-
- 2 Posts
I’m please to hear that the issue was resolved. Having magic quotes set to "on" has never been a "company policy" but rather a default in the past. The default was changed to off for PHP 5.3 for three reasons, 1) due to the fact that many PHP scripts is incorrectly only checking PHP version and assuming that magic quotes is off when detecting 5.3 instead of testing the actual value of the magic quotes setting, 2) the feature is deprecated (for very very good reasons) an slated to be removed completely in PHP 6.0 and 3) magic quotes as such encourages sloppy programming and likely creates as many issues as it solves.
Best Regards
If you are going to be using 5.3 with Evo, you really need to get magic_quotes_gpc turned off for your php configuration; this should be easily doable with a .user.ini file in your root directory. There is functionality in MODx to strip quotes when this is enabled, but it does not work in all environments with 5.3 because of the new deprecated error that is triggered when the checks for this setting are executed.
This should get solved for the next release when proper deprecated error handling is implemented.
-
- 24,544 Posts
Quote from: imandic at Jan 05, 2011, 11:19 PM
foreach ($_GET as $key => $value) {
$_GET[$key] = stripslashes($value);
}
foreach ($_POST as $key => $value) {
$_POST[$key] = stripslashes($value);
}
Perfect, thanx man...That’s the only working solution for me...
Note that this may fail if one of the post values is an array, which can happen with FormIt and certain kinds of TVs, for example.
I believe this will work in that case:
<?php
function _stripslashes_deep($value) {
$value = is_array($value) ?
array_map('_stripslashes_deep', $value) :
stripslashes($value);
return $value;
}