Last week I was checking out the code of an open source project that used 10 lines of code just to generate a “odd” / “even” string to use as the html class for a table row. This is how I do it in one line:
<?php
for($i=0;$i<10;$i++) {
$row = (!isset($row) [...]
Intro
HtmlPurifier is a standards-compliant HTML filter library written in PHP. HTML Purifier will not only remove all malicious code (better known as XSS) with a thoroughly audited, secure yet permissive whitelist, it will also make sure your documents are standards compliant.
Although Codeigniter comes with it’s own XSS filtering method $this->input->xss_clean() I prefer the use of [...]