From 7c09ea3ecfe7ba537ac393ac779ccd2c1a412562 Mon Sep 17 00:00:00 2001 From: crazywhalecc Date: Thu, 7 Aug 2025 16:16:35 +0800 Subject: [PATCH] Remove spc.env.log due to potential secret leaks --- src/SPC/exception/ExceptionHandler.php | 9 --------- src/globals/defines.php | 1 - 2 files changed, 10 deletions(-) diff --git a/src/SPC/exception/ExceptionHandler.php b/src/SPC/exception/ExceptionHandler.php index 458151424..3bd3fe5d5 100644 --- a/src/SPC/exception/ExceptionHandler.php +++ b/src/SPC/exception/ExceptionHandler.php @@ -125,15 +125,6 @@ public static function handleSPCException(SPCException $e): void self::logError("\n----------------------------------------\n"); - // put getenv info to log - $env_log = fopen(SPC_ENV_LOG, 'a'); - $env_info = getenv(); - if ($env_info) { - foreach ($env_info as $k => $v) { - fwrite($env_log, $k . ' = ' . $v . PHP_EOL); - } - } - self::logError('⚠ The ' . ConsoleColor::cyan('console output log') . ConsoleColor::red(' is saved in ') . ConsoleColor::none(SPC_OUTPUT_LOG)); if (file_exists(SPC_SHELL_LOG)) { self::logError('⚠ The ' . ConsoleColor::cyan('shell output log') . ConsoleColor::red(' is saved in ') . ConsoleColor::none(SPC_SHELL_LOG)); diff --git a/src/globals/defines.php b/src/globals/defines.php index 2574cd099..71d6277bc 100644 --- a/src/globals/defines.php +++ b/src/globals/defines.php @@ -94,7 +94,6 @@ const SPC_LOGS_DIR = WORKING_DIR . DIRECTORY_SEPARATOR . 'log'; const SPC_OUTPUT_LOG = SPC_LOGS_DIR . DIRECTORY_SEPARATOR . 'spc.output.log'; const SPC_SHELL_LOG = SPC_LOGS_DIR . DIRECTORY_SEPARATOR . 'spc.shell.log'; -const SPC_ENV_LOG = SPC_LOGS_DIR . DIRECTORY_SEPARATOR . 'spc.env.log'; ConsoleLogger::$date_format = 'H:i:s'; ConsoleLogger::$format = '[%date%] [%level_short%] %body%';