Fix CAPTCHA

This commit is contained in:
Floorb 2022-03-13 13:46:39 -04:00
parent 69d1ab44ce
commit 52a1c86bd9
2 changed files with 3 additions and 11 deletions

View file

@ -5,8 +5,8 @@ use JetBrains\PhpStorm\ArrayShape;
#[ArrayShape(['code' => "mixed|string", 'image_src' => "string"])] #[ArrayShape(['code' => "mixed|string", 'image_src' => "string"])]
function captcha($color, $mode, $mul, $allowed) : array { function captcha($color, $mode, $mul, $allowed) : array {
$bg_path = '/assets/img/captcha/'; $bg_path = __DIR__ . '/../assets/img/captcha/';
$font_path = '/assets/font/'; $font_path = __DIR__ . '/../assets/fonts/';
if ($mul == "on") { if ($mul == "on") {
$captcha_config = array( $captcha_config = array(
@ -128,7 +128,7 @@ if (isset($_GET['_CAPTCHA'])) {
session_start(); session_start();
$captcha_config = unserialize($_SESSION['_CAPTCHA']['config']); $captcha_config = unserialize(@$_SESSION['_CAPTCHA']['config']);
if (!$captcha_config) if (!$captcha_config)
exit(); exit();

View file

@ -1,14 +1,6 @@
<?php <?php
use Illuminate\Database\Eloquent\Collection; use Illuminate\Database\Eloquent\Collection;
function getreports($conn, $count = 10) {
$query = $conn->prepare('SELECT * FROM user_reports LIMIT ?');
$query->execute([$count]);
return $query->fetchAll();
}
function tagsToHtml(array | Collection $tags) : string { function tagsToHtml(array | Collection $tags) : string {
$output = ""; $output = "";
foreach ($tags as $tagObj) { foreach ($tags as $tagObj) {