php - Codeigniter XSS filter removing inline style on post Ajax data -


i have admin panel in codeignter. have enabled global xss filtering in application/config/config.php because need time.

i have form add email templates. when trying post email template html content xss filter removes style attribute posted content. tried

$temptate_body = $this->input->post('temptate_body', false); 

when globally disabled xss filter works fine don't want disable globally.

form posting through jquery ajax. googled encode template body content php htmlentities function does, not luck.

any ideas how disable behavior site admins able assign inline styles email templates?

you read raw input data in order bypass filter, shouldn't that.

the 'global_xss_filtering' setting automatic xss filtering on input, bad practice , that's why feature deprecated in codeigniter 3.

don't enable global xss filtering; escape manually on output; , please, unless form of yours in admin panel , trust source, don't skip escaping because strips style attribute. attribute stripped because potentially dangerous.


Comments

Popular posts from this blog

html - Firefox flex bug applied to buttons? -

html - Missing border-right in select on Firefox -

c# - two queries in same method -