From 29bf26fd116efef65e259c6c3a344e645ec9105c Mon Sep 17 00:00:00 2001 From: ZoaChou Date: Tue, 7 Jun 2016 16:47:05 +0800 Subject: [PATCH] Fix #113 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 判断操作是否合法前先定义$instance --- library/think/App.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/library/think/App.php b/library/think/App.php index 9c417d6b..32dcb426 100644 --- a/library/think/App.php +++ b/library/think/App.php @@ -272,13 +272,14 @@ class App Hook::listen('module_init', $request); try { + $instance = Loader::controller($controller, $config['url_controller_layer'], $config['use_controller_suffix'], $config['empty_controller']); + // 获取当前操作名 $action = $actionName . $config['action_suffix']; if (!preg_match('/^[A-Za-z](\w)*$/', $action)) { // 非法操作 throw new \ReflectionException('illegal action name :' . $actionName); } - $instance = Loader::controller($controller, $config['url_controller_layer'], $config['use_controller_suffix'], $config['empty_controller']); // 执行操作方法 $call = [$instance, $action];