From 872de9e406720d81d8a4e68d9b0627dae6791c9b Mon Sep 17 00:00:00 2001 From: tianshujie Date: Tue, 4 Mar 2025 15:30:42 +0800 Subject: [PATCH] * [bug#60250,done,0.5h] check estimate. --- module/execution/control.php | 6 ++++++ module/execution/lang/de.php | 1 + module/execution/lang/en.php | 1 + module/execution/lang/fr.php | 1 + module/execution/lang/zh-cn.php | 1 + 5 files changed, 10 insertions(+) diff --git a/module/execution/control.php b/module/execution/control.php index 09a18644ef..76069b3fa7 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -968,6 +968,12 @@ class execution extends control if($_POST) { + if(!preg_match("/^[1-9]\d*\.\d*|0\.\d*[1-9]\d*|[1-9]\d*$/", (string)$this->post->estimate) || $this->post->estimate <= 0) + { + dao::$errors['estimate'] = sprintf($this->lang->execution->errorFloat, $this->lang->execution->estimate); + return $this->sendError(dao::getError()); + } + $burn = $this->execution->getBurnByExecution($executionID, $execution->begin, 0); $withLeft = $this->post->withLeft ? $this->post->withLeft : 0; $burnData = form::data($this->config->execution->form->fixfirst) diff --git a/module/execution/lang/de.php b/module/execution/lang/de.php index 62c9e6b380..063d5c37fd 100644 --- a/module/execution/lang/de.php +++ b/module/execution/lang/de.php @@ -412,6 +412,7 @@ $lang->execution->errorNameRepeat = "Child %s of the same parent st $lang->execution->errorAttrMatch = "Parent stage's attribute is [%s], the attribute needs to be consistent with the parent stage."; $lang->execution->errorLesserPlan = "『%s』cannot be less than the plan start time『%s』。"; $lang->execution->errorParentExecution = "The current stage is the parent stage, and it's unaccessible."; +$lang->execution->errorFloat = '『%s』应当不小于0的数字,可以是小数。'; $lang->execution->accessDenied = "Zugriff zu {$lang->executionCommon} verweigert!"; $lang->execution->tips = 'Hinweis'; $lang->execution->afterInfo = "%s wurde erstellt. Als nächstes können Sie "; diff --git a/module/execution/lang/en.php b/module/execution/lang/en.php index f19e2ed049..dde4b40718 100644 --- a/module/execution/lang/en.php +++ b/module/execution/lang/en.php @@ -412,6 +412,7 @@ $lang->execution->errorNameRepeat = "Child %s of the same parent st $lang->execution->errorAttrMatch = "Parent stage's attribute is [%s], the attribute needs to be consistent with the parent stage."; $lang->execution->errorLesserPlan = "『%s』cannot be less than the plan start time『%s』。"; $lang->execution->errorParentExecution = "The current stage is the parent stage, and it's unaccessible."; +$lang->execution->errorFloat = '『%s』应当不小于0的数字,可以是小数。'; $lang->execution->accessDenied = "Your access to {$lang->executionCommon} is denied!"; $lang->execution->tips = 'Note'; $lang->execution->afterInfo = "%s is created. Next you can "; diff --git a/module/execution/lang/fr.php b/module/execution/lang/fr.php index 247deb3ad4..ed5e717c86 100644 --- a/module/execution/lang/fr.php +++ b/module/execution/lang/fr.php @@ -412,6 +412,7 @@ $lang->execution->errorNameRepeat = "Child %s of the same parent st $lang->execution->errorAttrMatch = "Parent stage's attribute is [%s], the attribute needs to be consistent with the parent stage."; $lang->execution->errorLesserPlan = "『%s』cannot be less than the plan start time『%s』。"; $lang->execution->errorParentExecution = "The current stage is the parent stage, and it's unaccessible."; +$lang->execution->errorFloat = '『%s』应当不小于0的数字,可以是小数。'; $lang->execution->accessDenied = "Votre accès au {$lang->executionCommon} est refusé ! Désolé."; $lang->execution->tips = 'Note'; $lang->execution->afterInfo = "Le %s a été créé avec succès ! Ensuite vous pouvez "; diff --git a/module/execution/lang/zh-cn.php b/module/execution/lang/zh-cn.php index 7289e86ccb..92a7ce2294 100644 --- a/module/execution/lang/zh-cn.php +++ b/module/execution/lang/zh-cn.php @@ -412,6 +412,7 @@ $lang->execution->errorNameRepeat = "相同父阶段的子%s名称 $lang->execution->errorAttrMatch = "父阶段类型为[%s],阶段类型需与父阶段一致"; $lang->execution->errorLesserPlan = "『%s』应当不小于计划开始时间『%s』。"; $lang->execution->errorParentExecution = '当前阶段是父阶段,不允许访问。'; +$lang->execution->errorFloat = '『%s』应当是不小于0的数字,可以是小数。'; $lang->execution->accessDenied = "您无权访问该{$lang->executionCommon}!"; $lang->execution->tips = '提示'; $lang->execution->afterInfo = "%s添加成功,您现在可以进行以下操作:";