Filter Url Before Running

I am new to Yii and I want to know how I can filter the URL(meaning, replacing unexpected characters) before running the action.

Thanks in advance!

Can you provide an example of an unexpected character please? We don’t know what unexpected character for you can be :) If you are talking about security you can filter your $_GET parameters with htmlpurifier see:

http://www.yiiframework.com/doc/api/1.1/CHtmlPurifier

Hi. A more simpler scenario would be, how can I filter the HTML values before submitting a form? For example, I want to prevent this kind of url:

/index.php/id=%0d%0aContent-Type…

in this example you can see that a certain combination of characters will be executed(i.e crlf injection). So before submitting the form, I want to filter first my input. For example, when I type ‘\n’ or ‘\r’ in my textbox, those characters must be filtered out first so that I cannot see them appearing in the url. This is a very noobie question but I want to know if there is a way available already in yii to facilitate this.