|
phpInputValidator July 28, 2009 04:39PM |
Registered: 5 years ago Posts: 14 |
Hey,
I was wonder if you had time if you could take a look at a project I have been working on to validate php input and give me any feed back. It can work in conjunction with HTMLPurifier.
https://www.assembla.com/wiki/show/phpInputValidator/
Thanks
|
Re: phpInputValidator July 29, 2009 01:59AM |
Registered: 5 years ago Posts: 204 |
it's simple.. yes it can be used.. But you should only ever use HTMLPurifier when you are dealing with Input that Contains HTML content only!
input such as plain text from textboxes/textareas that contain no HTML, you should use another method.
you maybe interested in PHP filters such as filter_var() and filter_input() (use this for validating $_GET, $_POST etc, and use the filter_var() for the rest.
see http://uk3.php.net/filter_var for more details on filter_var() & filter_input()
|
Re: phpInputValidator July 29, 2009 10:50AM |
Admin Registered: 6 years ago Posts: 2,640 |
|
Re: phpInputValidator July 29, 2009 11:36AM |
Registered: 5 years ago Posts: 14 |
it's simple.. yes it can be used.. But you should only ever use HTMLPurifier when you are dealing with Input that Contains HTML content only!
input such as plain text from textboxes/textareas that contain no HTML, you should use another method.
HTMLPurifier is only included/used when invoked and the value is a string. So to use is you would have to do:
$textarea = $getvar->get('textarea', 'POST', 'string', array('purify' => _PIV_VAR_PURIFY));
If not invoked it use a preg_match Feyd came up with to strip html tags. If its a string.
you maybe interested in PHP filters such as filter_var() and filter_input() (use this for validating $_GET, $_POST etc, and use the filter_var() for the rest..... I'm curious to know what this does differently from PHP's new built-in input validator.
I actually use filter_var to validate certain types because it was quicker and more efficient.
As to how its different, here are the things off the top of my head. This is not everything.
|
Re: phpInputValidator August 12, 2009 06:52PM |
Registered: 5 years ago Posts: 14 |
|
Re: phpInputValidator August 13, 2009 03:17PM |
Admin Registered: 6 years ago Posts: 2,640 |