Fix JSON payload parsing in payment server

This commit is contained in:
Hamza-Ayed
2026-08-01 04:23:30 +03:00
parent 915d517ba7
commit 811b23ca9e
4 changed files with 23 additions and 3 deletions
+11
View File
@@ -184,6 +184,17 @@ function authenticateJWT(bool $isReg = false): object
function filterRequest($requestname, $type = 'string') {
// If $_POST is empty, try parsing JSON from php://input
if (empty($_POST)) {
$json = file_get_contents('php://input');
if (!empty($json)) {
$data = json_decode($json, true);
if (is_array($data)) {
$_POST = $data;
}
}
}
if (isset($_POST[$requestname]) && !empty($_POST[$requestname])) {
$value = trim($_POST[$requestname]);
// Remove any control characters