From f84d7a413e257f3e21890851305c9ac4c12ba9d1 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Thu, 25 Feb 2021 12:08:58 +0100 Subject: [PATCH 1/2] POST/GET reloaded if empty in ajax --- pandora_console/ajax.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pandora_console/ajax.php b/pandora_console/ajax.php index 9b59695555..eaeec43ed6 100644 --- a/pandora_console/ajax.php +++ b/pandora_console/ajax.php @@ -64,6 +64,15 @@ if (isset($config['console_log_enabled']) === true ini_set('error_log', 0); } +// Sometimes input is badly retrieved from caller... +if (empty($_REQUEST) === true) { + $data = explode('&', urldecode(file_get_contents('php://input'))); + foreach ($data as $d) { + $r = explode('=', $d, 2); + $_REQUEST[$r[0]] = $r[1]; + } +} + // Hash login process. if (isset($_GET['loginhash']) === true) { $loginhash_data = get_parameter('loginhash_data', ''); From 8fcac749f5954ad95dbc198bb9ed0d658ef9fca0 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Thu, 25 Feb 2021 12:09:41 +0100 Subject: [PATCH 2/2] POST/GET reloaded if empty in ajax --- pandora_console/ajax.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pandora_console/ajax.php b/pandora_console/ajax.php index eaeec43ed6..b653fbd5c5 100644 --- a/pandora_console/ajax.php +++ b/pandora_console/ajax.php @@ -69,7 +69,8 @@ if (empty($_REQUEST) === true) { $data = explode('&', urldecode(file_get_contents('php://input'))); foreach ($data as $d) { $r = explode('=', $d, 2); - $_REQUEST[$r[0]] = $r[1]; + $_POST[$r[0]] = $r[1]; + $_GET[$r[0]] = $r[1]; } }