From 8f23a9f9c2a86155e91144358f1f5c4579dec690 Mon Sep 17 00:00:00 2001 From: Giam Teck Choon Date: Tue, 27 Aug 2024 21:57:09 +0800 Subject: [PATCH 8/9] main.php - Declare $form['forwards'] as array. This is needed to fix the following error: PHP Fatal error: Uncaught TypeError: join(): Argument #1 ($pieces) must be of type array, string given in main.php:138 Signed-off-by: Giam Teck Choon --- main.php | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/main.php b/main.php index df90711..09a320f 100644 --- a/main.php +++ b/main.php @@ -62,19 +62,19 @@ else { /* sorting */ switch($_GET['sort']) { case 'personal': - array_subkey_sort($list, "personal"); - break; + array_subkey_sort($list, "personal"); + break; case 'rpersonal': - array_subkey_rsort($list, "personal"); + array_subkey_rsort($list, "personal"); break; - case 'raddress': - array_subkey_rsort($list, "username"); + case 'raddress': + array_subkey_rsort($list, "username"); break; - + default: - array_subkey_sort($list, "username"); + array_subkey_sort($list, "username"); break; } @@ -96,7 +96,7 @@ else { else { unset($list[$key]); } - + } } } @@ -128,13 +128,14 @@ else { )); } else { - + foreach($list as $key => $info) { if(isset($info['forwards']) && count($info['forwards']) == 0) { $forwards = " "; } - else { + else { + $info['forwards'] = []; $forwards = @join("
", $info['forwards']); } @@ -162,13 +163,13 @@ echo template_replace($parts['main_table_end'], array( 'image_alias' => $parts['image_alias'], 'image_edit' => $parts['image_edit'], 'image_remove' => $parts['image_remove'] -)); +)); if(trim($_GET['query'] == '')) { echo template_replace($parts['main_catchall_start'], array( - 'catchall' => $language['main']['catchall'], + 'catchall' => $language['main']['catchall'], 'catchall_none' => $language['main']['catchall_none'] - )); + )); if(count($info) > 0) { foreach($list as $key => $info) { @@ -184,7 +185,7 @@ if(trim($_GET['query'] == '')) { } } } - + echo template_replace($parts['main_catchall_end'], array( 'catchall_set' => $language['main']['catchall_set'], 'catchall_text' => $language['main']['catchall_text'] -- 2.34.1