From 94dac9d130b3719613821b1f5958a934c4a4e858 Mon Sep 17 00:00:00 2001 From: ralf Date: Tue, 6 Dec 2022 10:08:49 +0100 Subject: [PATCH] fix PHP 8.1 TypeError: Unsupported operand types: string - float Also change config template, to enforce only entering numbers, as the label suggested before --- api/src/Auth.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/src/Auth.php b/api/src/Auth.php index 28010b4a22..764b306442 100644 --- a/api/src/Auth.php +++ b/api/src/Auth.php @@ -229,7 +229,7 @@ class Auth if (is_null($daysLeftUntilChangeReq) && !empty($GLOBALS['egw_info']['server']['warn_about_upcoming_pwd_change'])) { // maxage - passwordage = days left until change is required - $daysLeftUntilChangeReq = ($GLOBALS['egw_info']['server']['change_pwd_every_x_days'] - ((DateTime::to('now','ts')-($alpwchange_val?$alpwchange_val:0))/86400)); + $daysLeftUntilChangeReq = ((float)$GLOBALS['egw_info']['server']['change_pwd_every_x_days'] - ((DateTime::to('now','ts')-($alpwchange_val?$alpwchange_val:0))/86400)); } if ($alpwchange_val == 0 || // admin requested password change $passwordAgeBorder > $alpwchange_val || // change password every N days policy requests change