diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f592c5c..e4013049 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## 2026-04-23 +- Applied a repository-wide PHP 8 compatibility sweep across PHP sources to harden array iteration/count/key checks, normalize `date()` timestamp casting, and quote bare `delete/edit/remove` string concatenations. + ## 2026-01-31 - Rebuilt the Steam Workshop picker search to rely solely on Steam Community scraping (matching the working curl flow) and updated the request preview to show the actual Steam URL instead of a local panel endpoint. - Added adapter AppID lookup for Workshop search so the picker can query Steam even when the server XML lacks a clear default installer entry. diff --git a/Crypt/XXTEA.php b/Crypt/XXTEA.php index 0efab149..dfbe22f1 100644 --- a/Crypt/XXTEA.php +++ b/Crypt/XXTEA.php @@ -92,12 +92,12 @@ class Crypt_XXTEA { } else { return PEAR::raiseError('The secret key must be a string or long integer array.'); } - if (count($k) > 4) { + if (count((array)$k) > 4) { return PEAR::raiseError('The secret key cannot be more than 16 characters or 4 long values.'); - } elseif (count($k) == 0) { + } elseif (count((array)$k) == 0) { return PEAR::raiseError('The secret key cannot be empty.'); - } elseif (count($k) < 4) { - for ($i = count($k); $i < 4; $i++) { + } elseif (count((array)$k) < 4) { + for ($i = count((array)$k); $i < 4; $i++) { $k[$i] = 0; } } @@ -206,7 +206,7 @@ class Crypt_XXTEA { * PEAR_Error on failure */ function _encryptArray($v) { - $n = count($v) - 1; + $n = count((array)$v) - 1; $z = $v[$n]; $y = $v[0]; $q = floor(6 + 52 / ($n + 1)); @@ -264,7 +264,7 @@ class Crypt_XXTEA { * PEAR_Error on failure */ function _decryptArray($v) { - $n = count($v) - 1; + $n = count((array)$v) - 1; $z = $v[$n]; $y = $v[0]; $q = floor(6 + 52 / ($n + 1)); @@ -300,7 +300,7 @@ class Crypt_XXTEA { * @return string the string */ function _long2str($v, $w) { - $len = count($v); + $len = count((array)$v); $s = ''; for ($i = 0; $i < $len; $i++) { $s .= pack('V', $v[$i]); diff --git a/biedi.php b/biedi.php index ceeaa87e..4b864105 100644 --- a/biedi.php +++ b/biedi.php @@ -5,7 +5,7 @@ $arrayElements = explode(";", $tagsList); echo "Contains ".sizeof($arrayElements)." elements
-----------------

"; $counter = 0; - foreach($arrayElements as $vehicle) + foreach ((array)$arrayElements as $vehicle) { $vehicleValues = explode(",", $vehicle); echo" @@ -33,7 +33,7 @@ $arrayElements = explode(";", $tagsList); echo "Contains ".sizeof($arrayElements)." elements
-----------------

"; $counter = 0; - foreach($arrayElements as $vehicle) + foreach ((array)$arrayElements as $vehicle) { $vehicleValues = explode(",", $vehicle); echo" @@ -51,7 +51,7 @@ $tagsList=$_POST['tags_list']; $arrayElements = explode(";", $tagsList); $counter = 0; - foreach($arrayElements as $vehicle) + foreach ((array)$arrayElements as $vehicle) { $vehicleValues = explode(",", $vehicle); $step1 = str_replace('[', '',$vehicleValues[0]); diff --git a/docs/COPILOT_TODO.md b/docs/COPILOT_TODO.md index 21f28cdb..e874dc62 100644 --- a/docs/COPILOT_TODO.md +++ b/docs/COPILOT_TODO.md @@ -3,3 +3,4 @@ - Surface pagination controls in the Workshop picker so users can request additional batches from the new Steam Web API search endpoint. - Add an admin-facing toggle that makes it clear when the HTML scraper fallback is in use and lets staff force API-only mode if Valve ever objects. - Add Workshop result preview thumbnails and author links in the picker for easier browsing. +- Add a lightweight admin UI report that flags remaining PHP files still relying on legacy PHP 7 constructs not covered by the automated compatibility pass. diff --git a/home.php b/home.php index 022bd327..d499283c 100644 --- a/home.php +++ b/home.php @@ -103,7 +103,7 @@ function heading() // Use parent expiration date for subusers if(!is_null($info['users_parent']) && is_numeric($info['users_parent'])){ $parentInfo = $db->getUserById($info['users_parent']); - if(is_array($parentInfo) && array_key_exists("user_expires", $parentInfo) && $parentInfo['user_expires'] != "X"){ + if(is_array($parentInfo) && array_key_exists("user_expires", (array)$parentInfo) && $parentInfo['user_expires'] != "X"){ $info['user_expires'] = $parentInfo['user_expires']; } } @@ -166,7 +166,7 @@ function ogpHome() if(!empty($server_homes)) { $servers_by_game_name = array(); - foreach( $server_homes as $server_home ) + foreach ((array)$server_homes as $server_home) { if(isset($settings['check_expiry_by']) and $settings['check_expiry_by'] == "once_logged_in") { @@ -178,7 +178,7 @@ function ogpHome() ksort($servers_by_game_name); $game_homes_list = "