Reputation: 178
I got a problem about automatic add slashes for ajax post data After I commit my code to test server, when I login admin, then Catalog->Attributes->Manage Attribute Sets -> Select a attribute set -> change a group name -> click the "save attribute set" button -> view attribute set detail, the changes can't be saved.
I dump the data var_dump($this->getRequest()->getParam('data')); all the double quotes are converted to \".
anyone have idea about this sorry for my poor english
Upvotes: 0
Views: 608
Reputation: 1555
Perhaps you have Magic Quotes on?
To disable Magic Quotes (as seen here):
in php.ini
; Magic quotes
;
; 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
or in .htaccess
php_flag magic_quotes_gpc Off
As always you should sanitize your data, so i normally don't rely on magic quotes and turn it off.
Upvotes: 0