trabajando con CI 2.2 Creo que la solución de treeface dejará input-> get(), input-> cookie() etc no siendo xss_cleaned. (usamos get in oauth requests, etc.) El cambio de configuración global impide que el constructor los escape y la clase principal todavía tiene xss_clean por defecto en FALSE en estos métodos ...
Básicamente, he implementado la misma solución en más métodos.
class MY_Input extends CI_Input {
/* fixes to allow xss_clean to be disabled on a per field basis
* [ e.g. tinymce html content with style/class/event attributes ]
* initial ref : http://stackoverflow.com/questions/3788476/codeigniter-disable-xss-filtering-on-a-post-basis
* this is based on CI 2.2
* the above (stackoverflow) solution only updates the post method - which means all the rest (get, get_post, cookie, server, request_headers, get_request_header)
* NB : we need GET to allow oauth type activities !
*
* 1 - change the global config to xss_clean = false [ otherwise the constructor will 'xss_clean' everything before we have a chance to say no ! ]
* 2 - make all of methods that take the xss_clean parameter use TRUE as default value
* 3 - we can now pass the second parameter in as FALSE if we do not want to xss_clean
*/
function get($index = '', $xss_clean = TRUE)
{
return parent::get($index, $xss_clean);
}
function post($index = '', $xss_clean = TRUE)
{
return parent::post($index, $xss_clean);
}
function get_post($index = '', $xss_clean = TRUE)
{
return parent::get($index, $xss_clean);
}
function cookie($index = '', $xss_clean = TRUE)
{
return parent::cookie($index, $xss_clean);
}
function server($index = '', $xss_clean = TRUE)
{
return parent::server($index, $xss_clean);
}
function request_headers($xss_clean = TRUE)
{
return parent::request_headers($xss_clean);
}
function get_request_header($index, $xss_clean = TRUE)
{
return parent::get_request_header($index, $xss_clean);
}
}
esperanza esto es de alguna ayuda para alguien
hombre
gracias pasan 2 horas para this.I tuvo problema al guardar las imágenes a través del filtrado base64 ckeditor.XSS era falso, pero configurarlo cierto en el archivo de configuración de mi colega – mokNathal
revise este blog http://tekina.info/xss-filtering-ckeditor/ –