diff --git a/module/testcase/model.php b/module/testcase/model.php index b8812a4fe8..a2a8eb24a6 100644 --- a/module/testcase/model.php +++ b/module/testcase/model.php @@ -2774,18 +2774,6 @@ class testcaseModel extends model return array('sceneMaps'=>$sceneMaps,'topScenes'=>$topScenes); } - /** - * Check config. - * - * @param string $str - * @access public - * @return bool - */ - function checkConfigValue($str) - { - return preg_match("/^[a-zA-Z]{1,10}$/",$str); - } - /** * 存储 xmind 配置。 * Save xmind config. diff --git a/module/testcase/zen.php b/module/testcase/zen.php index a16cadb292..2e24f5463a 100644 --- a/module/testcase/zen.php +++ b/module/testcase/zen.php @@ -1779,8 +1779,9 @@ class testcaseZen extends testcase { $key = $config['key']; $value = $config['value']; - if(!$this->testcase->checkConfigValue($value)) $configErrors[$key][] = sprintf($this->lang->testcase->errorXmindConfig, $this->lang->testcase->{$key}); + if(!preg_match("/^[a-zA-Z]{1,10}$/", $value)) $configErrors[$key][] = sprintf($this->lang->testcase->errorXmindConfig, $this->lang->testcase->{$key}); } + if(!empty($configErrors)) dao::$errors = $configErrors; $map = array();