diff --git a/lib/sanitize.inc b/lib/sanitize.inc new file mode 100644 index 0000000..e02beac --- /dev/null +++ b/lib/sanitize.inc @@ -0,0 +1,40 @@ +, Jam Warehouse (Pty) Ltd, South Africa + */ + +/** + * Accepts a web encoded string and outputs a "clean" string. + */ + +function sanitize($string) { + // Remove '(' and ')' + $xss_array = array("(" => "#&40;", ")" => "#&41;"); + // Remove all HTML tags. + $string = strtr(strip_tags(urldecode($string)), $xss_array); + return $string; +} + +?>