From: Jouni Malinen Date: Wed, 12 Sep 2018 22:04:40 +0000 (+0300) Subject: HS 2.0: Fix T&C server database check X-Git-Tag: hostap_2_7~183 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1d73531fdbb5b231c18542f4a9e70abde4fb9b18;p=thirdparty%2Fhostap.git HS 2.0: Fix T&C server database check It was possible for the wait loop to exit early due to the $row[0] == 1 check returning false if the database value was not yet set. Fix this by updated the $waiting default value only if the database actually has a value for this field. Signed-off-by: Jouni Malinen --- diff --git a/hs20/server/www/terms.php b/hs20/server/www/terms.php index e360be5f4..e269b3cd3 100644 --- a/hs20/server/www/terms.php +++ b/hs20/server/www/terms.php @@ -59,8 +59,10 @@ if (!$accept) { if (!$row) { die("No current session for the specified MAC address"); } - $waiting = $row[0] == 1; - $ack = $row[1] == 1; + if (strlen($row[0]) > 0) + $waiting = $row[0] == 1; + if (strlen($row[1]) > 0) + $ack = $row[1] == 1; $res->closeCursor(); if (!$waiting) break;