From 27ff697d555331e54efd5fd2fe9539c3895d68ea Mon Sep 17 00:00:00 2001 From: Andrew Ruthven Date: Thu, 29 Feb 2024 00:14:59 +1300 Subject: [PATCH] Ensure we give bindec a value Resolves this warning in PHP 7.4.0: Deprecated: bindec(): Passing null to parameter #1 ($binary_string) of type string is deprecated in /usr/share/davical/inc/ui/principal-edit.php on line 412 --- inc/ui/principal-edit.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/inc/ui/principal-edit.php b/inc/ui/principal-edit.php index 9ba65d73..9a1e6684 100644 --- a/inc/ui/principal-edit.php +++ b/inc/ui/principal-edit.php @@ -409,7 +409,8 @@ function build_privileges_html( $ed, $fname ) { $btn_sd = htmlspecialchars(translate('Schedule Deliver')); $btn_sd_title = htmlspecialchars(translate('Privileges to allow delivery of scheduling messages')); $btn_ss = htmlspecialchars(translate('Schedule Send')); $btn_ss_title = htmlspecialchars(translate('Privileges to delegate scheduling decisions')); - $privs_dec = bindec($ed->Value($fname)); + $privs = $ed->Value($fname); + $privs_dec = isset($privs) ? bindec($privs) : 0; $privileges_set = sprintf('
%s', $fname, "\n"); for( $i=0; $i < count($privilege_names); $i++ ) { $privilege_set = ( (1 << $i) & $privs_dec ? ' CHECKED' : '');