From 592e33122ae0048fdd23eae6de4397f59df4f619 Mon Sep 17 00:00:00 2001 From: Phillip Davis Date: Wed, 20 May 2026 13:45:50 +0930 Subject: [PATCH 1/3] fix: avoid trying to access array offset on false This fixes log file messages like {"reqId":"rRziQ2UaFono1r96TEdK","level":3,"time":"2026-05-19T12:44:35+00:00","remoteAddr":"::1", "user":"Brian","app":"PHP","method":"PUT", "url":"\/server\/remote.php\/webdav\/textfile0.txt-chunking-42-3-2", "message":"Trying to access array offset on false at \/var\/www\/html\/server\/lib\/private\/Files\/Storage\/Wrapper\/Encryption.php#475"} --- lib/private/Files/Storage/Wrapper/Encryption.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/private/Files/Storage/Wrapper/Encryption.php b/lib/private/Files/Storage/Wrapper/Encryption.php index d3697f1b9a5e..6131ec45b226 100644 --- a/lib/private/Files/Storage/Wrapper/Encryption.php +++ b/lib/private/Files/Storage/Wrapper/Encryption.php @@ -472,7 +472,7 @@ public function fopen($path, $mode) { if (!empty($encryptionModuleId)) { $encryptionModule = $this->encryptionManager->getEncryptionModule($encryptionModuleId); $shouldEncrypt = true; - } elseif (empty($encryptionModuleId) && $info['encrypted'] === true) { + } elseif ($info !== false && $info->isEncrypted()) { // we come from a old installation. No header and/or no module defined // but the file is encrypted. In this case we need to use the // OC_DEFAULT_MODULE to read the file From 107d87f256222de67256df099acdbe97f6ee34d7 Mon Sep 17 00:00:00 2001 From: Phillip Davis Date: Wed, 20 May 2026 13:57:30 +0930 Subject: [PATCH 2/3] fix: handle passing null to normalizeUrl This will fix log file messages like {"reqId":"oAKAHIupnZUz4ujYoFqY","level":3,"time":"2026-05-19T12:46:31+00:00","remoteAddr":"::1", "user":"--","app":"PHP","method":"POST", "url":"\/server\/ocs\/v1.php\/apps\/federation\/api\/v1\/request-shared-secret", "message":"strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated at \/var\/www\/html\/server\/apps\/federation\/lib\/DbHandler.php#298"} --- apps/federation/lib/DbHandler.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/federation/lib/DbHandler.php b/apps/federation/lib/DbHandler.php index 3b88ffeabd55..0878e2471a82 100644 --- a/apps/federation/lib/DbHandler.php +++ b/apps/federation/lib/DbHandler.php @@ -293,6 +293,9 @@ protected function hash($url) { * @return string */ protected function normalizeUrl($url) { + if ($url === null) { + $url = ''; + } $normalized = $url; if (\strpos($url, 'https://') === 0) { From de8166cd059ddab23e9d94ab606861437a5e8eb4 Mon Sep 17 00:00:00 2001 From: Phillip Davis Date: Mon, 8 Jun 2026 18:32:35 +0930 Subject: [PATCH 3/3] chore: changelog for minor code fixes --- changelog/unreleased/41597 | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 changelog/unreleased/41597 diff --git a/changelog/unreleased/41597 b/changelog/unreleased/41597 new file mode 100644 index 000000000000..a6f1182b735c --- /dev/null +++ b/changelog/unreleased/41597 @@ -0,0 +1,7 @@ +Fix: Adjust code to avoid PHP8 messages + +Avoid trying to access array offset on false in the encryption storage wrapper. + +Handle passing null to normalizeUrl in the federation DbHandler. + +https://github.com/owncloud/core/pull/41597