From 67c58ec774e1878f24aa27f128b75365dab9da6b Mon Sep 17 00:00:00 2001 From: Andriy Utkin Date: Tue, 13 Feb 2024 00:23:49 +0000 Subject: [PATCH 1/2] www/template/ajax/users.php: Reindent a code chunk before changes --- www/template/ajax/users.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/www/template/ajax/users.php b/www/template/ajax/users.php index 148eab7b2..46e520d48 100644 --- a/www/template/ajax/users.php +++ b/www/template/ajax/users.php @@ -37,16 +37,16 @@ - data as $id => $info){ - $email_list = ''; $emails = ''; $email = ''; $tmp = ''; - $emails = explode('|', $info['email']); - foreach($emails as $id => $email){ - $email = explode(':', $email); - $tmp[$id] = $email[0]; - } - $email_list = implode(', ', $tmp); - ?> +data as $id => $info){ + $email_list = ''; $emails = ''; $email = ''; $tmp = ''; + $emails = explode('|', $info['email']); + foreach($emails as $id => $email){ + $email = explode(':', $email); + $tmp[$id] = $email[0]; + } + $email_list = implode(', ', $tmp); +?> From 7e46efde616f366974f616ee972090d3d4096cf0 Mon Sep 17 00:00:00 2001 From: Andriy Utkin Date: Tue, 13 Feb 2024 00:24:08 +0000 Subject: [PATCH 2/2] www/template/ajax/users.php: Fix array operation 2024/02/12 18:04:30 [error] 1354432#1354432: *20269 FastCGI sent in stderr: " PHP Warning: Cannot assign an empty string to a string offset in /usr/share/bluecherry/www/template/ajax/users.php on line 46 PHP Warning: implode(): Invalid arguments passed in /usr/share/bluecherry/www/template/ajax/users.php on line 48 Since tmp is used as `$tmp[$id]`, it should be constructed as an array, not a string. This fixes both warnings. --- www/template/ajax/users.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/template/ajax/users.php b/www/template/ajax/users.php index 46e520d48..c38623830 100644 --- a/www/template/ajax/users.php +++ b/www/template/ajax/users.php @@ -39,7 +39,7 @@ data as $id => $info){ - $email_list = ''; $emails = ''; $email = ''; $tmp = ''; + $email_list = ''; $emails = ''; $email = ''; $tmp = array(); $emails = explode('|', $info['email']); foreach($emails as $id => $email){ $email = explode(':', $email);