From f8fa2e3d69a61a230c2a04a74b54dc703d5e6505 Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Sat, 2 May 2020 18:35:19 +0200 Subject: [PATCH] LSsession :: includeFile : fix using LSlog when is not already load Only log errors and use error_log() if LSlog is not loaded. --- public_html/includes/class/class.LSsession.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/public_html/includes/class/class.LSsession.php b/public_html/includes/class/class.LSsession.php index 08b0f0da..5d38b842 100644 --- a/public_html/includes/class/class.LSsession.php +++ b/public_html/includes/class/class.LSsession.php @@ -108,16 +108,23 @@ class LSsession { if ($path[0] != '/') { $found = stream_resolve_include_path($path); if ($found === false) { - LSlog :: debug("includeFile($file, external=$external) : file $path not found in include path."); + $log_msg = "includeFile($file, external=$external) : file $path not found in include path."; + if (class_exists('LSlog')) + LSlog :: warning($log_msg); + else + error_log($log_msg); return; } else { - LSlog :: debug("includeFile($file, external=$external) : file '$path' found in include path as '$found'."); $path = $found; } } else if (!file_exists($path)) { - LSlog :: debug("includeFile($file, external=$external) : file not found ($local_path / $path)"); + $log_msg = "includeFile($file, external=$external) : file not found ($local_path / $path)"; + if (class_exists('LSlog')) + LSlog :: warning($log_msg); + else + error_log($log_msg); return; } return include_once($path);