diff options
| author | thomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2007-11-25 19:45:38 +0000 |
|---|---|---|
| committer | thomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2007-11-25 19:45:38 +0000 |
| commit | 902ec1456d958887bdc7ee4e1b5877a3c72db5b7 (patch) | |
| tree | c07c0ebddbbf3e573ace129256806f15fe99c11f /roundcubemail/program/include/main.inc | |
| parent | 916676eafd05379db18614e3c0431fdbd422feb2 (diff) | |
More input sanitizing
git-svn-id: https://svn.roundcube.net/trunk@931 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/include/main.inc')
| -rw-r--r-- | roundcubemail/program/include/main.inc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/roundcubemail/program/include/main.inc b/roundcubemail/program/include/main.inc index f0c603090..55cd8efce 100644 --- a/roundcubemail/program/include/main.inc +++ b/roundcubemail/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 |
