![]() |
How to show Original HTML post after sanitizing? - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22) +--- Thread: How to show Original HTML post after sanitizing? (/showthread.php?tid=53382) |
How to show Original HTML post after sanitizing? - El Forum - 07-21-2012 [eluser]Unknown[/eluser] I am writing a Blog module, and sanitize the blog_post at INPUT with Code: $this->form_validation->set_rules('blog_data', 'Blog Post', 'trim|required|min_length[5]|xss_clean'); Now that the input has been sanitized I have lost the HTML styling, Can anyone recommend a way to get the styling back to show the blog post in the original styling as posted by the user? If sanitizing the HTML data at OUTPUT (instead of INPUT) is a good practice then how do people retain the original styling? For example, wordpress is storing HTML data of user blogs in original form with all styling tags intact (raw HTML). But it must be sanitizing it during output. Then how does it retain the original styling? How to do it in codeigniter? Please help I have been banging my head for 3 days now .:/ How to show Original HTML post after sanitizing? - El Forum - 07-22-2012 [eluser]NeoArc[/eluser] Try $_POST['blog_data'] or $this->input->post('blog_data'); The satinized value is returned by $this->form_validation->set_value('blog_data'), only if you define a rule, of course. How to show Original HTML post after sanitizing? - El Forum - 07-22-2012 [eluser]InsiteFX[/eluser] htmlentities How to show Original HTML post after sanitizing? - El Forum - 07-22-2012 [eluser]NeoArc[/eluser] Yeah, htmlentities, if you have only the satinized data available ![]() |