From d9dd6cab7bd40853db5f8a9387e0b34f8179e788 Mon Sep 17 00:00:00 2001 From: Florin-Ciprian Bodin Date: Tue, 26 Mar 2024 16:58:31 +0200 Subject: [PATCH] Update index.php to PHP8 and prep for using request() in admin --- index.php | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/index.php b/index.php index 3482eb0..6fa3580 100644 --- a/index.php +++ b/index.php @@ -260,19 +260,16 @@ $request = new RequestVars('', false); // this is needed to prevent unicode normalization $super_globals_disabled = $request->super_globals_disabled(); -// enable super globals to get literal value -if (!$super_globals_disabled) -{ - //$request->disable_super_globals(); -} - - - /* To do: Should be switched to i.e. $request->request('style', 1); */ $_GET = array_change_key_case($_GET, CASE_LOWER); $_POST = array_change_key_case($_POST, CASE_LOWER); +// enable super globals to get literal value +if (!$super_globals_disabled) +{ + //$request->disable_super_globals(); +} /** * This is used to report a fatal error that we cannot display with the Display @@ -616,12 +613,30 @@ try $_SESSION['sort_mode'] = 'a'; //default sort order } + // this is needed to prevent unicode normalization + $super_globals_disabled = $request->super_globals_disabled(); + + // enable super globals to get literal value + if ($super_globals_disabled) + { + $request->enable_super_globals(); + } + if (count($_FILES) > 0) //deal with any request to upload files: { $upload = new Upload($you); //the constructor checks if you have permission to upload $upload->do_upload(); } + // this is needed to prevent unicode normalization + $super_globals_disabled = $request->super_globals_disabled(); + + // enable super globals to get literal value + if (!$super_globals_disabled) + { + //$request->disable_super_globals(); + } + if (USE_LOGIN_SYSTEM) { $logout = $request->is_set_get('logout') ? $request->get('logout') : 'false';