-
- 58 Posts
Thanks for the fast answer!
Since this is not my server I cannot do anything about this?
Strange that they added magic_quotes_gpc when they upgraded since it’s marked for removal...
-
- 24,544 Posts
You should be able to disable magic quotes in a php.ini in the site root or programmatically in index.php if your host won’t allow php.ini (most good hosts will allow it).
http://php.net/manual/en/security.magicquotes.disabling.php
-
- 58 Posts
Now I’ve gotten response from one.com and they claim that they allways have had magic quotes on, strange thing is that MODx did not stop working until they made the upgrade from PHP 5.2 to 5.3, if they are right, they must have changed something else that made PHP or MODx add additional \ to all SQL INSERT querys.
Anyway, they won’t allow me to turn magic quotes off so I need to work around it. Could I make a plugin for the site that uses regular expressions to remove the extra \ before insertion into database or in worst case before the page is viewed.
Which event could this plugin run at?
Right, the problem is magic_quotes are now deprecated features in 5.3 and MODx changes were made to address this. Unfortunately, at the current time, if you use 5.3 you need these settings disabled. Can you not do this in your .htaccess file?
-
- 24,544 Posts
Your plugin should listen for OnWebPagePrerender.
It would look something like this:
<?php
$source = &$modx->documentOutput;
$source = str_replace('\"','"', $source);
?>
or for MODx Revolution:
<?php
$output = &$modx->resource->_output;
$source = str_replace('\"','"', $source);
?>