From b45bb0d7d5788888e59b3be1dffdd6bcaea76954 Mon Sep 17 00:00:00 2001 From: Emil Zhai Date: Wed, 30 Nov 2022 06:59:19 +0000 Subject: [PATCH] fix: undefined variable $data error on auth failure --- Action.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Action.php b/Action.php index aa819bc..45d1484 100644 --- a/Action.php +++ b/Action.php @@ -64,13 +64,14 @@ class Access_Action extends Typecho_Widget implements Widget_Interface_Do $this->checkAuth(); # 鉴权 if(!$this->request->isGet()) throw new Exception('Method Not Allowed', 405); - + $rpcType = $this->request->get('rpc'); # 业务类型 $statistic = new Access_Statistic($this->request); $data = $statistic->invoke($rpcType); # 进行业务分发并调取数据 $errCode = 0; $errMsg = 'ok'; } catch (Exception $e) { + $data = null; $errCode = $e->getCode(); $errMsg = $e->getMessage(); }