From 52a1c86bd91aa33585ac55a6e6fc825a508a5452 Mon Sep 17 00:00:00 2001 From: Floorb <132411956+Neetpone@users.noreply.github.com> Date: Sun, 13 Mar 2022 13:46:39 -0400 Subject: [PATCH] Fix CAPTCHA --- includes/captcha.php | 6 +++--- includes/functions.php | 8 -------- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/includes/captcha.php b/includes/captcha.php index d28c967..032b6c2 100644 --- a/includes/captcha.php +++ b/includes/captcha.php @@ -5,8 +5,8 @@ use JetBrains\PhpStorm\ArrayShape; #[ArrayShape(['code' => "mixed|string", 'image_src' => "string"])] function captcha($color, $mode, $mul, $allowed) : array { - $bg_path = '/assets/img/captcha/'; - $font_path = '/assets/font/'; + $bg_path = __DIR__ . '/../assets/img/captcha/'; + $font_path = __DIR__ . '/../assets/fonts/'; if ($mul == "on") { $captcha_config = array( @@ -128,7 +128,7 @@ if (isset($_GET['_CAPTCHA'])) { session_start(); - $captcha_config = unserialize($_SESSION['_CAPTCHA']['config']); + $captcha_config = unserialize(@$_SESSION['_CAPTCHA']['config']); if (!$captcha_config) exit(); diff --git a/includes/functions.php b/includes/functions.php index e5b6fa4..854d845 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -1,14 +1,6 @@ prepare('SELECT * FROM user_reports LIMIT ?'); - $query->execute([$count]); - - return $query->fetchAll(); -} - - function tagsToHtml(array | Collection $tags) : string { $output = ""; foreach ($tags as $tagObj) {