summaryrefslogtreecommitdiff
path: root/program/include/main.inc
diff options
context:
space:
mode:
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