diff --git a/bin/ztcli b/bin/ztcli index fd696fa825..b6352cf9e9 100755 --- a/bin/ztcli +++ b/bin/ztcli @@ -74,5 +74,4 @@ else } $app->parseRequest(); -$app->setParams(); $app->loadModule(); diff --git a/framework/api/router.class.php b/framework/api/router.class.php index ffbad8fda1..ef441d72c8 100644 --- a/framework/api/router.class.php +++ b/framework/api/router.class.php @@ -191,11 +191,7 @@ class api extends router public function loadModule() { /* If the version of api don't exists, call parent method. */ - if(!$this->version) - { - parent::setParams(); - return parent::loadModule(); - } + if(!$this->version) return parent::loadModule(); $entry = strtolower($this->entry); include($this->appRoot . "api/$this->version/entries/$entry.php"); diff --git a/framework/base/router.class.php b/framework/base/router.class.php index 8dcfd6ed43..1651cab8a6 100644 --- a/framework/base/router.class.php +++ b/framework/base/router.class.php @@ -1540,11 +1540,12 @@ class baseRouter $_COOKIE = validater::filterParam($_COOKIE, 'cookie'); } } - + return true; } catch(EndResponseException $endResponseException) { echo $endResponseException->getContent(); + return false; } } @@ -2146,6 +2147,8 @@ class baseRouter public function loadModule() { try { + if(is_null($this->params) and !$this->setParams()) return false; + /* 调用该方法 Call the method. */ $module = $this->control; diff --git a/roadrunner/cron-worker.php b/roadrunner/cron-worker.php index c8f69799e9..468fde14c0 100644 --- a/roadrunner/cron-worker.php +++ b/roadrunner/cron-worker.php @@ -32,5 +32,4 @@ $common = $app->loadCommon(); $app->moduleName = 'cron'; $app->methodName = 'ajaxExec'; $app->setControlFile(); -$app->setParams(); $app->loadModule(); diff --git a/www/api.php b/www/api.php index cb723df37e..c49b0b40ee 100644 --- a/www/api.php +++ b/www/api.php @@ -46,7 +46,6 @@ $app->parseRequest(); /* Old version need check priv here, new version check priv in entry. */ if(!$app->version) $common->checkPriv(); -$app->setParams(); $app->loadModule(); $output = ob_get_clean(); diff --git a/www/index.php b/www/index.php index fe323ffc08..eb5d7ef5c1 100644 --- a/www/index.php +++ b/www/index.php @@ -68,6 +68,7 @@ if($app->clientDevice == 'mobile' and (strpos($config->version, 'pro') === 0 or if(!empty($_GET['display']) && $_GET['display'] == 'card') $config->default->view = 'xhtml'; $app->parseRequest(); +if(!$app->setParams()) return; $app->setParams(); $common->checkPriv(); $common->checkIframe(); diff --git a/www/install.php.tmp b/www/install.php.tmp index ae68c66261..122755b3fa 100644 --- a/www/install.php.tmp +++ b/www/install.php.tmp @@ -33,5 +33,4 @@ $app->setDebug(); if(isset($config->installed) and $config->installed) $app->connectDB(); $app->parseRequest(); -$app->setParams(); $app->loadModule(); diff --git a/www/upgrade.php.tmp b/www/upgrade.php.tmp index 1c335ae061..a2f2165848 100644 --- a/www/upgrade.php.tmp +++ b/www/upgrade.php.tmp @@ -80,8 +80,4 @@ if($app->isContainer()) /* Run it. */ $app->parseRequest(); -if($common->checkUpgradeStatus()) -{ - $app->setParams(); - $app->loadModule(); -} +if($common->checkUpgradeStatus()) $app->loadModule();