开发者

kohana framework, using Security:xss_clean in validation filters

开发者 https://www.devze.com 2023-01-12 07:58 出处:网络
I have this part of code: ->filter(\'username\', \'Security::xss_clean\') ->filter(\'url\', \'Security::xss_clean\')

I have this part of code:


    ->filter('username', 'Security::xss_clean')
                ->filter('url', 'Security::xss_clean')
                ->filter('text', 'Security::xss_clean')

but it not works and after validation parametres will be inserted via ORM into table co开发者_JAVA百科lumns with html tags. so, what i do wrong? or this method works only when writing output data, but not return changed value back to variable?


Which variable are you using for the database input?

If your validation is like this:

$validation = Validate::factory ...

Then you will need to use:

$validation['url'];

instead of

 $_POST['url'];
0

精彩评论

暂无评论...
验证码 换一张
取 消