From 5eba926ef03daabbc80a0642c3dd33a4033d3a9d Mon Sep 17 00:00:00 2001 From: songchenxuan Date: Fri, 10 Nov 2023 13:05:52 +0800 Subject: [PATCH] * Merge commit d2a43a93f6. --- module/editor/control.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/editor/control.php b/module/editor/control.php index 90937c7838..6359c8b46e 100644 --- a/module/editor/control.php +++ b/module/editor/control.php @@ -161,7 +161,7 @@ class editor extends control if(strpos(strtolower($filePath), strtolower($this->app->getBasePath())) !== 0) return $this->send(array('result' => 'fail', 'message' => $this->lang->editor->editFileError)); $fileName = empty($_POST['fileName']) ? '' : trim($this->post->fileName); - if($action != 'newPage' and empty($fileName)) return $this->send(array('result' => 'fail', 'message' => $this->lang->editor->emptyFileName)); + if($action == 'newPage' and empty($fileName)) return $this->send(array('result' => 'fail', 'message' => $this->lang->editor->emptyFileName)); if($action != 'edit' and $action != 'newPage') $filePath = $this->editor->getSavePath($filePath, $action); if($action != 'edit' and $action != 'newPage' and file_exists($filePath) and !$this->post->override) return $this->send(array('result' => 'fail', 'message' => $this->lang->editor->repeatFile));