From da2f7365857c3e7927203e31b86187554fdd0b03 Mon Sep 17 00:00:00 2001 From: ShamazinGG <72302878+ShamazinGG@users.noreply.github.com> Date: Mon, 11 Dec 2023 07:52:21 +0300 Subject: [PATCH] fix extractState when state is null (#2760) --- src/Screen/Screen.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Screen/Screen.php b/src/Screen/Screen.php index e9088dbc9..beb8603cb 100644 --- a/src/Screen/Screen.php +++ b/src/Screen/Screen.php @@ -188,16 +188,15 @@ public function asyncParticalLayout(Layout $layout, Request $request) */ protected function extractState(): Repository { + $state = request()->post('_state', session()->get('_state')); // Check if the '_state' parameter is missing - if (! request()->request->has('_state') && session()->missing('_state')) { + if ($state === null) { // Return an empty Repository object return new Repository(); } - // Extract the encrypted state from the '_state' parameter, and deserialize it - $raw = request()->post('_state') ?? session()->get('_state'); - - return Crypt::decrypt($raw); + //deserialize '_state' parameter + return Crypt::decrypt($state); } /**