Port the code to PHP 8.5.

Replace the short open tags and the removed functions (mcrypt, mysql_error,
salt-less crypt). Decode the reCAPTCHA reply as JSON, turn off mysqli
exceptions, drop stripslashes(), and default missing input values.
Fix the misplaced continue in prune_images().
This commit is contained in:
tim
2026-09-25 21:18:58 +02:00
parent 15e81e17cc
commit 00829a0c0d
23 changed files with 145 additions and 130 deletions
+3 -1
View File
@@ -1,4 +1,4 @@
<?
<?php
require_once(__DIR__ . '/config.lib.php');
global $db;
function open_db($state) {
@@ -9,6 +9,8 @@ function open_db($state) {
$view_user = config('DB_USER');
$view_pass = config('DB_PASS');
$db_name = config('DB_NAME');
// PHP 8.1+ throws exceptions by default; keep the old return-value checks working
mysqli_report(MYSQLI_REPORT_OFF);
$db = new mysqli($hostname, $view_user, $view_pass, $db_name);
if ($db->connect_error) {
die ("Unable to connect to database");