From 5c63437e318da72b2f11c69bfafd7d709ddcdb0a Mon Sep 17 00:00:00 2001 From: Timotei Date: Fri, 6 Sep 2024 14:45:10 +0300 Subject: [PATCH 1/3] Fix error when AUTH_KEY not defined --- src/debug2.cls.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/debug2.cls.php b/src/debug2.cls.php index 8e528299e..55c0b1e6a 100644 --- a/src/debug2.cls.php +++ b/src/debug2.cls.php @@ -89,7 +89,7 @@ public static function FilePath($type) if ($type == 'debug.purge') { $type = 'purge'; } - $rand = substr(md5(substr(AUTH_KEY, -16)), -16); + $rand = defined('AUTH_KEY') ? substr(md5(substr(AUTH_KEY, -16)), -16) : ''; return $type . $rand . '.log'; } From b2f4b8822b254d48f5ed3669be27b74187f36dfd Mon Sep 17 00:00:00 2001 From: Timotei Date: Fri, 6 Sep 2024 15:17:39 +0300 Subject: [PATCH 2/3] Further improvement --- src/debug2.cls.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/debug2.cls.php b/src/debug2.cls.php index 55c0b1e6a..6ab317e3c 100644 --- a/src/debug2.cls.php +++ b/src/debug2.cls.php @@ -89,7 +89,7 @@ public static function FilePath($type) if ($type == 'debug.purge') { $type = 'purge'; } - $rand = defined('AUTH_KEY') ? substr(md5(substr(AUTH_KEY, -16)), -16) : ''; + $rand = substr(md5(substr(defined('AUTH_KEY') ? AUTH_KEY : md5(__FILE__), -16)), -16); return $type . $rand . '.log'; } From 33aa549024b24864a72d6f7a59451018ae7307ae Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Fri, 6 Sep 2024 08:54:55 -0400 Subject: [PATCH 3/3] Update src/debug2.cls.php MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 6ab317e3c..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(defined('AUTH_KEY') ? AUTH_KEY : md5(__FILE__), -16)), -16); + $key = defined('AUTH_KEY') ? AUTH_KEY : md5(__FILE__); + $rand = substr(md5(substr($key, -16)), -16); return $type . $rand . '.log'; }