From 4b70991a4b46bfeb5bd38fed1b9facba3acd1815 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Thu, 14 Sep 2023 10:34:00 +0800 Subject: [PATCH] * Remove testcaseModel::checkConfigValue, and move it to testcaseZen::buildXmindConfig. --- module/testcase/model.php | 12 ------------ module/testcase/zen.php | 3 ++- 2 files changed, 2 insertions(+), 13 deletions(-) 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();