summaryrefslogtreecommitdiff
path: root/program/include/main.inc
diff options
context:
space:
mode:
authorthomascube <thomas@roundcube.net>2007-11-25 19:45:38 +0000
committerthomascube <thomas@roundcube.net>2007-11-25 19:45:38 +0000
commitd5342aabcfeddb959cc286befe6de5bf35fe9d76 (patch)
tree7410b56bccbae610578060555a86535d0c1b9863 /program/include/main.inc
parentc5799618997716288169b6fbcd1251f76788cd49 (diff)
More input sanitizing
Diffstat (limited to 'program/include/main.inc')
-rw-r--r--program/include/main.inc8
1 files changed, 8 insertions, 0 deletions
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