From e21c6f165d29eded24eb708e3f2f8d2904b25f86 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Tue, 26 May 2020 19:59:58 -0600 Subject: [PATCH] Not used anywhere so removing it $document_root_parent --- resources/php.php | 35 ++++++++++++++++------------------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/resources/php.php b/resources/php.php index 54c45b6ba7..705fbd29f8 100644 --- a/resources/php.php +++ b/resources/php.php @@ -24,26 +24,23 @@ Mark J Crane */ - //session handling - //start the session - if (function_exists('session_start')) { - if (!isset($_SESSION)) { - session_start(); - } +//session handling + //start the session + if (function_exists('session_start')) { + if (!isset($_SESSION)) { + session_start(); } - //regenerate sessions to avoid session id attacks such as session fixation - if (array_key_exists('security',$_SESSION) && $_SESSION['security']['session_rotate']['boolean'] == "true") { - $_SESSION['session']['last_activity'] = time(); - if (!isset($_SESSION['session']['created'])) { - $_SESSION['session']['created'] = time(); - } else if (time() - $_SESSION['session']['created'] > 28800) { - // session started more than 8 hours ago - session_regenerate_id(true); // rotate the session id - $_SESSION['session']['created'] = time(); // update creation time - } + } + //regenerate sessions to avoid session id attacks such as session fixation + if (array_key_exists('security',$_SESSION) && $_SESSION['security']['session_rotate']['boolean'] == "true") { + $_SESSION['session']['last_activity'] = time(); + if (!isset($_SESSION['session']['created'])) { + $_SESSION['session']['created'] = time(); + } else if (time() - $_SESSION['session']['created'] > 28800) { + // session started more than 8 hours ago + session_regenerate_id(true); // rotate the session id + $_SESSION['session']['created'] = time(); // update creation time } - - //get the document_root parent directory - $document_root_parent = join(array_slice(explode("\\",realpath($_SERVER["DOCUMENT_ROOT"])),0,-1), '/'); + } ?>