From 45712076d262e14daddbed086adada004c45ae6c Mon Sep 17 00:00:00 2001 From: JaguarJack Date: Wed, 23 Sep 2020 08:05:31 +0800 Subject: [PATCH] =?UTF-8?q?fixed:=E6=A8=A1=E5=9D=97Json=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E5=86=99=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extend/catcher/CatchAdmin.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/extend/catcher/CatchAdmin.php b/extend/catcher/CatchAdmin.php index 4f4066a..bd5390f 100644 --- a/extend/catcher/CatchAdmin.php +++ b/extend/catcher/CatchAdmin.php @@ -227,7 +227,11 @@ class CatchAdmin $info['enable'] = true; - file_put_contents($moduleJson, \json_encode($info, JSON_PRETTY_PRINT|JSON_UNESCAPED_UNICODE)); + if (!is_writeable($moduleJson)) { + chmod($moduleJson, 666); + } + + file_put_contents($moduleJson, \json_encode($info, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE)); return true; } @@ -251,6 +255,10 @@ class CatchAdmin $info['enable'] = false; + if (!is_writeable($moduleJson)) { + chmod($moduleJson, 666); + } + file_put_contents($moduleJson, \json_encode($info, JSON_PRETTY_PRINT|JSON_UNESCAPED_UNICODE)); return true;