From b3bd600ba0ffe397ef59f8360c9bb47ca460a35a Mon Sep 17 00:00:00 2001 From: Tim <162806658+timotei-litespeed@users.noreply.github.com> Date: Fri, 6 Sep 2024 15:55:56 +0300 Subject: [PATCH] Fix error when AUTH_KEY not defined (#739) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix error when AUTH_KEY not defined * Further improvement * Update src/debug2.cls.php Co-authored-by: Viktor Szépe --------- Co-authored-by: Timotei Co-authored-by: Hai Zheng Co-authored-by: Viktor Szépe --- src/debug2.cls.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/debug2.cls.php b/src/debug2.cls.php index 8e528299e..14bf6bf2f 100644 --- a/src/debug2.cls.php +++ b/src/debug2.cls.php @@ -89,7 +89,8 @@ public static function FilePath($type) if ($type == 'debug.purge') { $type = 'purge'; } - $rand = substr(md5(substr(AUTH_KEY, -16)), -16); + $key = defined('AUTH_KEY') ? AUTH_KEY : md5(__FILE__); + $rand = substr(md5(substr($key, -16)), -16); return $type . $rand . '.log'; }