Browse code

don't be too complicated. / add function to check for domain

git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@984 87cf0b9e-d624-0410-a070-f6ee81989793

bernd authored on 11/03/2008 11:04:36
Showing 1 changed files
... ...
@@ -124,7 +124,12 @@ function check_path( $input )
124 124
 
125 125
 function check_emailaddr( $input )
126 126
 {
127
-  return (preg_match("/^[a-z]+[a-z0-9]*[\.|\-|_]?[a-z0-9]+@([a-z0-9]*[\.|\-]?[a-z0-9]+){1,4}\.[a-z]{2,4}$/i", $input ) == 1);
127
+  return (bool) preg_match('/^[a-z0-9][a-z0-9%\[\]\.\-\_+]*@[a-z0-9\.\-]+\.[a-z]{2,4}/i', $input);
128
+}
129
+
130
+function check_domain( $input )
131
+{
132
+  return (bool) preg_match("/[a-z0-9\.\-]+\.[a-z]{2,4}$/i", $input );
128 133
 }
129 134
 
130 135