diff --git a/system/libs/pot/OTS_DB_MySQL.php b/system/libs/pot/OTS_DB_MySQL.php index 5ca7d28bc..318f2e9fc 100644 --- a/system/libs/pot/OTS_DB_MySQL.php +++ b/system/libs/pot/OTS_DB_MySQL.php @@ -165,7 +165,8 @@ public function __destruct() } if($this->logged) { - log_append('database.log', $_SERVER['REQUEST_URI'] . PHP_EOL . $this->getLog()); + $currentScript = $_SERVER['REQUEST_URI'] ?? $_SERVER['SCRIPT_FILENAME']; + log_append('database.log', $currentScript . PHP_EOL . $this->getLog()); } }