From d5342aabcfeddb959cc286befe6de5bf35fe9d76 Mon Sep 17 00:00:00 2001 From: thomascube Date: Sun, 25 Nov 2007 19:45:38 +0000 Subject: More input sanitizing --- program/include/main.inc | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'program/include/main.inc') diff --git a/program/include/main.inc b/program/include/main.inc index f0c603090..55cd8efce 100644 --- a/program/include/main.inc +++ b/program/include/main.inc @@ -1279,6 +1279,14 @@ function get_input_value($fname, $source, $allow_html=FALSE, $charset=NULL) return $value; } +/** + * Remove all non-ascii and non-word chars + * except . and - + */ +function asciiwords($str) +{ + return preg_replace('/[^a-z0-9.-_]/i', '', $str); +} /** * Remove single and double quotes from given string -- cgit v1.2.3