From 22e7e259d49389b1b77b8c3b23e4f881cf331cf8 Mon Sep 17 00:00:00 2001 From: Craig Knudsen Date: Sat, 31 Aug 2024 15:38:13 -0400 Subject: [PATCH 1/2] Fix for PHP deprecation --- includes/user.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/user.php b/includes/user.php index 33d740de6..dfaa3adb0 100644 --- a/includes/user.php +++ b/includes/user.php @@ -490,7 +490,7 @@ function user_get_users ( $publicOnly=false ) { "ORDER BY $order1 cal_login" ); if ( $res ) { while ( $row = dbi_fetch_row ( $res ) ) { - if ( strlen ( $row[1] ) && strlen ( $row[2] ) ) + if ( strlen($row[1] ?? '') && strlen($row[2] ?? '') ) $fullname = "$row[2] $row[1]"; else $fullname = $row[0]; From c6f266e06c4b6b8ea3c760601ee4eb174dfaad4c Mon Sep 17 00:00:00 2001 From: Craig Knudsen Date: Sat, 31 Aug 2024 15:48:02 -0400 Subject: [PATCH 2/2] PHP 8 deprecation fixes --- includes/user.php | 2 +- includes/views.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/includes/user.php b/includes/user.php index dfaa3adb0..f635094ff 100644 --- a/includes/user.php +++ b/includes/user.php @@ -188,7 +188,7 @@ function user_load_variables ( $login, $prefix ) { $GLOBALS[$prefix . 'lastname'] = $row[1]; $GLOBALS[$prefix . 'is_admin'] = $row[2]; $GLOBALS[$prefix . 'email'] = empty ( $row[3] ) ? '' : $row[3]; - if ( strlen ( $row[0] ) && strlen ( $row[1] ) ) + if ( strlen($row[0] ?? '') && strlen($row[1] ?? '') ) $GLOBALS[$prefix . 'fullname'] = "$row[0] $row[1]"; else $GLOBALS[$prefix . 'fullname'] = $login; diff --git a/includes/views.php b/includes/views.php index 45fa28326..509f22128 100644 --- a/includes/views.php +++ b/includes/views.php @@ -7,6 +7,7 @@ * @license https://gnu.org/licenses/old-licenses/gpl-2.0.html GNU GPL * @package WebCalendar */ +require_once 'includes/init.php'; /** * Initialize view variables and check permissions.