So recently at work I have been doing a lot of work with the Zend Framework, but I was having some issues with magic_quotes_gpc
being turned on in the PHP configuration of the server. The easy thing to do would be to disable magic_quotes_gpc in the php.ini and that solves the issue. However this was not an option in my case, as I didn’t want to fiddle with the configuration in case it broke anything else.
I had a look around for a solution and found one on Phil Brown’s Web Development Blog his post
Zend Framework Forms and magic_quotes_gpc which explains how to use Zend Filters to combat this issue. His solution works perfectly but you have to set the filter for each form element individually and I found this a bit of a chaw.
So I looked around to find a way of applying it to all elements within the form.
Here is the solution I came up with this is all the code you need to get it working. I am doing this for the Strip Slashes filter but will work with any standard or non standard filters.