From 2e5ea1bc6f5e35ca69a656456bf63d5d52d430b2 Mon Sep 17 00:00:00 2001 From: qkqpttgf <45693631+qkqpttgf@users.noreply.github.com> Date: Sat, 27 Aug 2022 15:55:06 +0800 Subject: [PATCH] fix: jsFilenot found --- common.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common.php b/common.php index f7cd53f..e2cc03e 100644 --- a/common.php +++ b/common.php @@ -188,7 +188,7 @@ function main($path) if (substr($_GET['jsFile'], -3)!='.js') return output('', 403); if (!($path==''||$path=='/')) return output('', 308, [ 'Location' => path_format($_SERVER['base_path'] . '/?jsFile=' . $_GET['jsFile']) ]); if (strpos($_GET['jsFile'], '/')>-1) $_GET['jsFile'] = splitlast($_GET['jsFile'], '/')[1]; - $jsFile = file_get_contents('js/' . $_GET['jsFile']); + $jsFile = file_get_contents(__DIR__ . '/js/' . $_GET['jsFile']); if (!!$jsFile) { return output( base64_encode($jsFile), 200, [ 'Content-Type' => 'text/javascript; charset=utf-8', 'Cache-Control' => 'max-age=' . 3*24*60*60 ], true ); } else {