Extra backslashes when Saving chunk in ModX Evolution




While editing chunk in ModX CMS all the quotes  became with extra backslashes.

So, code was:

<div id="item1">Item 1 </div>

But after pressing button Save code became like this with extra backslashes:

<div id=\"item1\">Item 1 </div>

No so long before I moved my site to a new server and there php variable "magic_quotes_gpc" had value "On", but ModX needs it to be "Off".

The solution of this problem is to set  "magic_quotes_gpc" to value "Off" in php.ini.

So you need to find php.ini and insert (or change) values:

; Magic quotes for incoming GET/POST/Cookie data.
magic_quotes_gpc = Off

; Magic quotes for runtime-generated data, e.g. data from SQL, from exec(), etc.
magic_quotes_runtime = Off

; Use Sybase-style magic quotes (escape ' with '' instead of \').
magic_quotes_sybase = Off

After changing php.ini you need to restart apache. In windows it’s like this:

Apache –k restart

In Linux you need to restart apache from root, syntax like this:

sudo service apache2 restart

If to restart under not-root account console asks to enter root password.

 




No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment





MarkiMarta.com. Notes of web-specialist
Since 2009
18+