Code

More precise domain test - take one
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 16 Nov 2009 10:15:49 +0000 (10:15 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 16 Nov 2009 10:15:49 +0000 (10:15 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14818 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/include/utils/class_tests.inc

index 343163dd1745047f511e5c9c6e22497a9ef386c2..4c6c60f652941b8bb800810dd5d4f239ae3e06ae 100644 (file)
@@ -127,7 +127,7 @@ class tests {
   /* Simple is domain check, it checks if the given string looks like "string(...).string" */
   public static function is_domain($str)
   {
-    return(preg_match("/^([a-z0-9\-]*)\.[a-z0-9\-]*$/i",$str));
+    return(preg_match("/^(([a-z0-9\-]{2,63})\.)*[a-z]{2,63}$/i",$str));
   }