Apply automated PHP8 safety transforms

Agent-Logs-Url: https://github.com/GameServerPanel/GSP/sessions/89922108-1604-44ae-949d-358d32b9d70a

Co-authored-by: iaretechnician <2749183+iaretechnician@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2026-04-23 14:01:37 +00:00 committed by GitHub
parent aca850b6cd
commit e44519c030
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
465 changed files with 1716 additions and 1716 deletions

View file

@ -72,7 +72,7 @@ function exec_ogp_module()
if($blacklisted_files !== FALSE)
{
$current_blacklist = array();
foreach($blacklisted_files as $blacklisted_file)
foreach ((array)$blacklisted_files as $blacklisted_file)
{
$current_blacklist[] = $blacklisted_file['file_path'];
}
@ -80,13 +80,13 @@ function exec_ogp_module()
if( isset( $_POST['save_to_blacklist'] ) )
{
foreach($_POST['blacklist'] as $file)
foreach ((array)$_POST['blacklist'] as $file)
{
$file = $db->real_escape_string($file);
$db->query("INSERT INTO `OGP_DB_PREFIXupdate_blacklist` SET file_path='$file';");
}
foreach($_POST['folder_files'] as $file)
foreach ((array)$_POST['folder_files'] as $file)
{
if(in_array($file,$current_blacklist))
{
@ -102,7 +102,7 @@ function exec_ogp_module()
if($blacklisted_files !== FALSE)
{
$current_blacklist = array();
foreach($blacklisted_files as $blacklisted_file)
foreach ((array)$blacklisted_files as $blacklisted_file)
{
$current_blacklist[] = $blacklisted_file['file_path'];
}
@ -198,7 +198,7 @@ function exec_ogp_module()
$x = 0;
$basedir_path = rtrim($_SERVER['DOCUMENT_ROOT'].dirname($_SERVER['SCRIPT_NAME']),DIRECTORY_SEPARATOR);
$preg_basedir_path = preg_quote($basedir_path,"/");
foreach( $dirlist as $item )
foreach ((array)$dirlist as $item)
{
# dirlist FM returns an array. Each element has 5 fields separated by the | character
if($item == "." or $item == "..")
@ -220,7 +220,7 @@ function exec_ogp_module()
$x++;
}
foreach($directorys as $directory)
foreach ((array)$directorys as $directory)
{
echo "<tr>\n".
"<td>".
@ -232,7 +232,7 @@ function exec_ogp_module()
}
$i = 0;
$unchecked = array();
foreach($files as $file)
foreach ((array)$files as $file)
{
$checked = in_array($file['filepath'],$current_blacklist) ? "checked='checked'" : "";
echo "<tr>\n".

View file

@ -137,7 +137,7 @@ function exec_ogp_module()
if($blacklisted_files !== FALSE)
{
$current_blacklist = array();
foreach($blacklisted_files as $blacklisted_file)
foreach ((array)$blacklisted_files as $blacklisted_file)
{
$current_blacklist[] = $blacklisted_file['file_path'];
}
@ -146,14 +146,14 @@ function exec_ogp_module()
include ( 'unzip.php' ); // array|false extractZip( string $zipFile, string $extract_path [, string $remove_path, array $blacklist, array $whitelist] )
$result = extractZip( $temp_dwl, $extract_path, $unwanted_path, '', '' );
if ( is_array( $result['extracted_files'] ) and count($result['extracted_files']) > 0 )
if ( is_array( $result['extracted_files'] ) and count((array)$result['extracted_files']) > 0 )
{
// Check file by file if already exists, if it matches, compares both files
// looking for changes determining if the file needs to be updated.
// Also determines if the file is writable
$filelist = array();
$i = 0;
foreach( $result['extracted_files'] as $file )
foreach ((array)$result['extracted_files'] as $file)
{
$filename = str_replace( $unwanted_path, "" , $file['filename'] );
$temp_file = $extract_path . DIRECTORY_SEPARATOR . $filename;
@ -224,7 +224,7 @@ function exec_ogp_module()
$result = extractZip( $temp_dwl, preg_replace("/\/$/","",$baseDir), $unwanted_path, $blacklist, $filelist );
if( is_array( $result['ignored_files'] ) and !empty( $result['ignored_files'] ) )
{
print_failure(get_lang_f('ignored_files',count($result['ignored_files'])));
print_failure(get_lang_f('ignored_files',count((array)$result['ignored_files'])));
echo get_lang_f("not_updated_files_blacklisted", implode("<br>", $result['ignored_files']) );
echo "<br><br><br>";
}
@ -265,7 +265,7 @@ function exec_ogp_module()
$modules = $db->getInstalledModules();
// update module manager first
foreach ( $modules as $row )
foreach ((array)$modules as $row)
{
if($row['folder'] == 'modulemanager')
{
@ -274,7 +274,7 @@ function exec_ogp_module()
}
}
foreach ( $modules as $row )
foreach ((array)$modules as $row)
{
if($row['folder'] == 'modulemanager')//already updated
continue;