From a761d83e567826cf5ee7901bd79fab251c5bbb82 Mon Sep 17 00:00:00 2001 From: plegall Date: Mon, 23 Jan 2023 15:49:07 +0100 Subject: [PATCH] issue #1841 during install (activate_core_themes) there is no session yet --- include/functions.inc.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/functions.inc.php b/include/functions.inc.php index 05a5c1cdf..a6e4d7105 100644 --- a/include/functions.inc.php +++ b/include/functions.inc.php @@ -599,6 +599,7 @@ function pwg_activity($object, $object_id, $action, $details=array()) $inserts = array(); $details_insert = pwg_db_real_escape_string(serialize($details)); $ip_address = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : null; + $session_id = !empty(session_id()) ? session_id() : 'none'; foreach ($object_ids as $loop_object_id) { @@ -614,7 +615,7 @@ function pwg_activity($object, $object_id, $action, $details=array()) 'object_id' => $loop_object_id, 'action' => $action, 'performed_by' => $performed_by, - 'session_idx' => session_id(), + 'session_idx' => $session_id, 'ip_address' => $ip_address, 'details' => $details_insert, 'user_agent' => $user_agent,