From 4ca198440ad34d7c962251407eed5d8a22737d08 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Sat, 7 Sep 2024 08:47:08 +0200 Subject: [PATCH] Fix PHP deprecation warnings (#9616) --- CHANGELOG.md | 1 + program/lib/Roundcube/rcube.php | 3 ++- program/lib/Roundcube/rcube_imap_generic.php | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c1776ab09f..a7679fc0b65 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -59,6 +59,7 @@ - Fix attachment name decoding when 'charset' parameter exists in the headers (#9376) - Fix deprecated (in PHP 8.4) use of session_set_save_handler() (#9060) - Fix potential HTTP protocol version mismatch (#8982) +- Fix PHP deprecation warnings (#9616) ## Release 1.6.9 diff --git a/program/lib/Roundcube/rcube.php b/program/lib/Roundcube/rcube.php index dd6d0537875..c0b409a1367 100644 --- a/program/lib/Roundcube/rcube.php +++ b/program/lib/Roundcube/rcube.php @@ -942,7 +942,8 @@ public function encrypt($clear, $key = 'des_key', $base64 = true) */ public function decrypt($cipher, $key = 'des_key', $base64 = true) { - if (strlen($cipher) == 0) { + // @phpstan-ignore-next-line + if (!is_string($cipher) || !strlen($cipher)) { return false; } diff --git a/program/lib/Roundcube/rcube_imap_generic.php b/program/lib/Roundcube/rcube_imap_generic.php index 8ce9b45de42..66daadb2c3a 100644 --- a/program/lib/Roundcube/rcube_imap_generic.php +++ b/program/lib/Roundcube/rcube_imap_generic.php @@ -659,7 +659,7 @@ protected function authenticate($user, $pass, $type = 'PLAIN') $gssapicontext->acquireCredentials($ccache); $token = ''; - $success = $gssapicontext->initSecContext($this->prefs['gssapi_context'], null, null, null, $token); + $success = $gssapicontext->initSecContext($this->prefs['gssapi_context'], '', 0, 0, $token); $token = base64_encode($token); } catch (Exception $e) { trigger_error($e->getMessage(), \E_USER_WARNING);