i am using my own mvc framework and i want to filter and escape all of the input and out put automatically. How do I?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Create a function which filters the data as you want. Then at the very beginning you put this code:
Alternatively you can create a class which wraps the post and get super globals. If I want to get a post variable in Codeigniter, for example, I do this:
And the function post could if you wanted to filter the value before it retrieves it (return your_filter_function($_POST[‘key’]));
Escaping output would be done by adding this feature to your database layer, or other sources of output.