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:
+3
-1
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user