Hello,
Is it possible to automatically clean code of type "XSS,etc..." with the function "clean", but automatically for all commands of type "copyfrom" and via a parameter in the file config.ini, example: AUTOCLEAN = 1 ?
A good idea ?
Regards ,
[section1:Base->clean]
myvar=myval1
<?php
/**
* XSS Class
*/
class Xss extends \DB\SQL\Mapper
{
protected $fields
function copyfrom($var,$func=NULL) {
global $f3;
if (is_string($var))
$var=\Base::instance()->$var;
if ($func)
$var=call_user_func($func,$var);
foreach ($var as $key=>$val)
if (in_array($key,array_keys($this->fields)))
$this->set($key,$f3->scrub($val));
}
}
Thank you in advance