Example #1
0
 /**
  * @return bool
  * @throws \Exception
  * @desc 前置控制器,session自动开启判断, 输入参数过滤
  */
 public function _before()
 {
     if (ZConfig::getField('project', 'auto_session', false)) {
         ZSession::start();
     }
     if (!empty($_POST)) {
         $_POST = $this->_filter($_POST);
     }
     if (!empty($_GET)) {
         $_GET = $this->_filter($_GET);
     }
     $params = Request::getParams();
     if (!empty($params)) {
         $params = $this->_filter($params);
         $_REQUEST = $params;
         Request::setParams($params);
     }
     return true;
 }