From 8a008bc17a44bc2ca20ad8eb4d9aceefa50fc333 Mon Sep 17 00:00:00 2001 From: liyuchun <563917701@qq.com> Date: Thu, 26 May 2022 02:48:59 +0000 Subject: [PATCH] * Fix bug for cli. --- framework/base/router.class.php | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/framework/base/router.class.php b/framework/base/router.class.php index 3b63bf756a..7fe25bb943 100644 --- a/framework/base/router.class.php +++ b/framework/base/router.class.php @@ -2075,6 +2075,19 @@ class baseRouter $defaultParams[$name] = $default; } + /** + * 根据PATH_INFO或者GET方式设置请求的参数。 + * Set params according PATH_INFO or GET. + */ + if($this->config->requestType != 'GET') + { + $this->setParamsByPathInfo($defaultParams); + } + else + { + $this->setParamsByGET($defaultParams); + } + if ('cli' === PHP_SAPI) { if ($this->params) @@ -2088,19 +2101,6 @@ class baseRouter } else { - /** - * 根据PATH_INFO或者GET方式设置请求的参数。 - * Set params according PATH_INFO or GET. - */ - if($this->config->requestType != 'GET') - { - $this->setParamsByPathInfo($defaultParams); - } - else - { - $this->setParamsByGET($defaultParams); - } - if($this->config->framework->filterParam == 2) { $_GET = validater::filterParam($_GET, 'get');