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
+6 -5
View File
@@ -1,7 +1,8 @@
<?
<?php
require_once('open_db.lib.php');
require_once("get_data.lib.php");
include_once("Numbers/Words.php");
if (stream_resolve_include_path("Numbers/Words.php"))
include_once("Numbers/Words.php");
function sort_options($link) {
$queue = get_queue();
@@ -64,7 +65,7 @@ function get_pager() {
$queue_url = $queue ? 1 : 0;
$string = '<div class="pager">';
$nw = new Numbers_Words();
$nw = class_exists('Numbers_Words') ? new Numbers_Words() : NULL;
// Are there later stories? Go backwards to them
$string .= '<span class="next">';
if ($start > 0) {
@@ -74,7 +75,7 @@ function get_pager() {
if (isset($_GET['show'])) $string .= '&amp;show='.$show;
if (isset($_GET['sort'])) $string .= '&amp;sort='.$sort;
if (isset($_GET['order'])) $string .= '&amp;order='.$order;
$articles = ($show == 1) ? "article" : $nw->toWords($show)." articles";
$articles = ($show == 1) ? "article" : ($nw ? $nw->toWords($show) : $show)." articles";
$string .= '">&laquo; Next '.$articles.'</a>';
}
$string .= "</span>\n";
@@ -88,7 +89,7 @@ function get_pager() {
if (isset($_GET['show'])) $string .= '&amp;show='.$show;
if (isset($_GET['sort'])) $string .= '&amp;sort='.$sort;
if (isset($_GET['order'])) $string .= '&amp;order='.$order;
$articles = ($show == 1) ? "article" : $nw->toWords($show)." articles";
$articles = ($show == 1) ? "article" : ($nw ? $nw->toWords($show) : $show)." articles";
$string .= '">Previous '.$articles.' &raquo;</a>';
}
$string .= "</span>\n";