From e015708c602441b090ceb563ec38d3ad16134f7b Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Mon, 25 Jan 2016 18:40:40 +0100 Subject: modify session state correctly --- src/frontend/pay.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/frontend/pay.php') diff --git a/src/frontend/pay.php b/src/frontend/pay.php index a517271a..5a028363 100644 --- a/src/frontend/pay.php +++ b/src/frontend/pay.php @@ -32,10 +32,9 @@ if (empty($hc)) session_start(); -$payments = get($_SESSION['payments'], array()); -$my_payment = get($payments[$hc]); +$payments = &pull($_SESSION, 'payments', array()); -if (null === $my_payment) +if (!isset($payments[$hc]) { http_response_code(400); echo json_encode(array( @@ -44,6 +43,8 @@ if (null === $my_payment) return; } +$my_payment = &$payments[$hc]; + $post_body = file_get_contents('php://input'); $now = new DateTime('now'); -- cgit v1.2.3