Filtered Input

Something like the CodeIgniter InputClass (or similar) would be great to sanitize user input.

http://codeigniter.com/user_guide/libraries/input.html

There is one: http://allframeworks.ru/blog/Yii/20.html

Here is a link to a cookbook example (in english, if that helps you):

http://www.yiiframework.com/doc/cookbook/67/