From ee50eed386504651ed01b0c4865d586d8c6ec573 Mon Sep 17 00:00:00 2001 From: cajus Date: Thu, 29 Oct 2009 09:22:52 +0000 Subject: [PATCH] Fixed php error message while checking for correct hsync/vsync git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14700 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../systems/goto/class_workstationService.inc | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/gosa-plugins/goto/admin/systems/goto/class_workstationService.inc b/gosa-plugins/goto/admin/systems/goto/class_workstationService.inc index 41f00a8f8..5b6329e6d 100644 --- a/gosa-plugins/goto/admin/systems/goto/class_workstationService.inc +++ b/gosa-plugins/goto/admin/systems/goto/class_workstationService.inc @@ -383,13 +383,15 @@ class workservice extends plugin if($this->acl_is_writeable("gotoXVsync")){ if(empty($val)){ $message[]= msgPool::required(_("VSync")); - }elseif (!preg_match ("/^\d+(\.\d+)?([-]\d+(\.\d+)?)?$/", $val)){ + }elseif (!preg_match ("/^\d+(\.\d+)?([+-]\d+(\.\d+)?)?$/", $val)){ $message[]= msgPool::invalid(_("VSync")); } else{ - list($v1,$v2)= preg_split ("/[-+]/", $val); - if ($v2 != ""){ - if ($v1 > $v2){ - $message[]= msgPool::invalid(_("VSync")); + if (!preg_match('/^\d+$/', $val)){ + list($v1,$v2)= preg_split ("/[-+]/", $val); + if ($v2 != ""){ + if ($v1 > $v2){ + $message[]= msgPool::invalid(_("VSync")); + } } } } @@ -403,10 +405,12 @@ class workservice extends plugin }elseif (!preg_match ("/^\d+(\.\d+)?([-]\d+(\.\d+)?)?$/", $val)){ $message[]= msgPool::invalid(_("HSync")); } else{ - list($v1,$v2)= preg_split ("/[-+]/", $val); - if ($v2 != ""){ - if ($v1 > $v2){ - $message[]= msgPool::invalid(_("HSync")); + if (!preg_match('/^\d+$/', $val)){ + list($v1,$v2)= preg_split ("/[-+]/", $val); + if ($v2 != ""){ + if ($v1 > $v2){ + $message[]= msgPool::invalid(_("HSync")); + } } } } -- 2.30.2