From f4b47c39379c79f0386a9f4edab51bd28e56ad10 Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 13 Aug 2008 09:20:04 +0000 Subject: [PATCH] Updated checks. -Fixed empty() checks for strings that may only consists of 0 git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12204 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../admin/mimetypes/class_mimetypeGeneric.inc | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/gosa-plugins/goto/admin/mimetypes/class_mimetypeGeneric.inc b/gosa-plugins/goto/admin/mimetypes/class_mimetypeGeneric.inc index c6e486578..436f5c8f4 100644 --- a/gosa-plugins/goto/admin/mimetypes/class_mimetypeGeneric.inc +++ b/gosa-plugins/goto/admin/mimetypes/class_mimetypeGeneric.inc @@ -244,8 +244,8 @@ class mimetype extends plugin /* Add gotoMimeFilePattern */ if(isset($_POST['AddNewFilePattern']) && isset($_POST['NewFilePattern'])){ if($this->acl_is_writeable("gotoMimeFilePattern")){ - $str = $_POST['NewFilePattern']; - if(!empty($str)){ + $str = trim($_POST['NewFilePattern']); + if($str != ""){ $this->use_gotoMimeFilePattern[] = $str; } } @@ -257,12 +257,12 @@ class mimetype extends plugin if($this->acl_is_writeable("gotoMimeApplication")){ $str = ""; if(isset($_POST['NewApplicationSelect']) && !empty($_POST['NewApplicationSelect'])){ - $str = get_post("NewApplicationSelect"); + $str = trim(get_post("NewApplicationSelect")); } if(isset($_POST['NewApplication']) && !empty($_POST['NewApplication'])){ - $str = get_post("NewApplication"); + $str = trim(get_post("NewApplication")); } - if(!empty($str) && !in_array($str,$this->use_gotoMimeApplication)){ + if($str != "" && !in_array($str,$this->use_gotoMimeApplication)){ $this->use_gotoMimeApplication[] = $str; } } @@ -276,12 +276,12 @@ class mimetype extends plugin if($this->acl_is_writeable("gotoMimeEmbeddedApplication")){ $str = ""; if(isset($_POST['NewEmbeddedApplicationSelect']) && !empty($_POST['NewEmbeddedApplicationSelect'])){ - $str = get_post('NewEmbeddedApplicationSelect'); + $str = trim(get_post('NewEmbeddedApplicationSelect')); } if(isset($_POST['NewEmbeddedApplication']) && !empty($_POST['NewEmbeddedApplication'])){ - $str = get_post('NewEmbeddedApplication'); + $str = trim(get_post('NewEmbeddedApplication')); } - if(!empty($str) && !in_array($str,$this->use_gotoMimeEmbeddedApplication)){ + if($str != "" && !in_array($str,$this->use_gotoMimeEmbeddedApplication)){ $this->use_gotoMimeEmbeddedApplication[] = $str; } } @@ -528,7 +528,7 @@ class mimetype extends plugin function check() { $message = plugin::check(); - if(empty($this->cn)){ + if($this->cn == "" ){ $message[] = msgPool::required(_("Name")); } if(!count($this->use_gotoMimeFilePattern)){ -- 2.30.2