I am trying to ensure we sanitize user input in our web app by filtering user input (blacklisting user data such as tags etc). Basically, Zend suggests that this be done specifically by the developer wherever one deems it as a requirement, so if Page A has a form, the filtering should be done in it's pageAaction() after the form data has been retrieved. All form data in my app is retrieved like this:
$this->_request->getParams();
$this->_request->getParam('specificParamName'); // to return specific param
Well, in my web app everything user inputs needs to be sanitized against the blacklisted fields. I want to obviously have my code centralized in one place rather than compare against the blacklist for each and every form. My understanding is that this should/must be done in the getParams() or getParam() method for the _request object since this is where we always retrieve form data from.
If yes, how can I do the same? I do not want to touch the core Zend class and add my own modifications to it.
If not, what is the best strategy to centralize our code?
Disclaimer: We are not using Zend forms, and are instead custom writing our own forms