From ac971f36d5f94e58bf591f9cd8a2c0e91eb7f251 Mon Sep 17 00:00:00 2001 From: Fredrick Brennan Date: Fri, 27 Jul 2018 20:08:03 +0800 Subject: [PATCH] Fix capcodes in PHP7.2. Close #299 --- inc/functions.php | 2 +- inc/mod/auth.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/inc/functions.php b/inc/functions.php index e7e5aa14..e730a9ce 100755 --- a/inc/functions.php +++ b/inc/functions.php @@ -1074,7 +1074,7 @@ function post(array $post) { } if ($post['mod'] && isset($post['capcode']) && $post['capcode']) { - $query->bindValue(':capcode', $post['capcode'], PDO::PARAM_INT); + $query->bindValue(':capcode', $post['capcode'], PDO::PARAM_STR); } else { $query->bindValue(':capcode', null, PDO::PARAM_NULL); } diff --git a/inc/mod/auth.php b/inc/mod/auth.php index 16da26a2..493149c8 100644 --- a/inc/mod/auth.php +++ b/inc/mod/auth.php @@ -212,8 +212,8 @@ function check_login($prompt = false) { } $mod = array( - 'id' => $user['id'], - 'type' => $user['type'], + 'id' => (int)$user['id'], + 'type' => (int)$user['type'], 'username' => $cookie[0], 'boards' => explode(',', $user['boards']) );