Code

Use msgPool::required function if no valid option name was given (fixes error 25)
authorpsc <psc@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 20 Mar 2009 21:05:56 +0000 (21:05 +0000)
committerpsc <psc@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 20 Mar 2009 21:05:56 +0000 (21:05 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6-lhm@13557 594d385d-05f5-0310-b6e9-bd551577e9d8

trunk/gosa-plugins/goto/admin/applications/class_applicationParameters.inc

index bfc6a855541b04a5c47dba0fc819d07b30ed9ac8..faab7b67d37c91dca019aedb0d95abfe58141df0 100644 (file)
@@ -186,7 +186,12 @@ class applicationParameters extends plugin
 
     /* Check for valid option names */
     for ($i= 0; $i<count($this->option_name); $i++){
-      if (!preg_match ("/^[a-z0-9_]+$/i", $this->option_name[$i])){
+      /* Check for empty option names */
+      if (!$this->option_name[$i]) {
+        $message[]= msgPool::required(_("Name"));
+      }
+      /* Check for valid option names */
+      elseif (!preg_match ("/^[a-z0-9_]+$/i", $this->option_name[$i])){
         $message[]= msgPool::invalid(_("Name"), $this->option_name[$i],"/^[a-z0-9_]+$/i");
       }
     }