Just though I should post on here as I’ve just had the
exact same problem but needed a different solution.
I tried all the fixes above (and more) for disabling magic quotes but it made no difference. In the end the problem was the PHP version.
I had successfully tested the MODx site in question on two different webhosts, one running PHP Version 5.2.10, and the other one running PHP Version 5.2.13. MODx worked fine on both these webhosts with the backslash issue not happening. But as soon as I moved the site to the client’s webhost, which was running PHP Version 5.3.2, the backslashes began appearing in all templates and chunks whenever I edited them.
So the
problem in my case was the PHP Version the webhosting company was running - PHP 5.3.2.
The solution was to have the webhosting company move the client’s website over to a different server that ran PHP Version 5.2.10 (although 5.2.13 probably would have worked fine as well).
They did this free of charge but it did take 24 hours to go through, and then the client had to update the nameservers to point to the new domain so that took another few hours. Another option would have been to move the client’s site over to one of the web hosts I knew were running the PHP version we needed but thankfully we didn’t have to do this.
Hope this prevents someone else from tearing out their hair
Harmony