From 6f33f4673fbd3f12e519db8caaf3889d816ea996 Mon Sep 17 00:00:00 2001 From: David Dreschner Date: Thu, 12 Feb 2026 15:26:40 +0100 Subject: [PATCH] fix: Fix deprecation warnings when using PHP >= 8.5 Signed-off-by: David Dreschner --- ...r-fix-deprecation-warning-on-PHP-8.5.patch | 35 ++++++++++ REUSE.toml | 6 ++ composer.json | 10 +-- composer.lock | 64 +++++++++---------- patches.json | 10 +++ patches.lock.json | 15 ++++- .../ContextChat/SubmitContentJobTest.php | 15 +++++ tests/Unit/Command/CreateAccountTest.php | 1 + .../ContextChat/ContextChatProviderTest.php | 3 + .../Controller/MessagesControllerTest.php | 2 - 10 files changed, 121 insertions(+), 40 deletions(-) create mode 100644 .patches/url-normalizer-fix-deprecation-warning-on-PHP-8.5.patch diff --git a/.patches/url-normalizer-fix-deprecation-warning-on-PHP-8.5.patch b/.patches/url-normalizer-fix-deprecation-warning-on-PHP-8.5.patch new file mode 100644 index 0000000000..a826f36f2f --- /dev/null +++ b/.patches/url-normalizer-fix-deprecation-warning-on-PHP-8.5.patch @@ -0,0 +1,35 @@ +From 5b09c44ecfeb59756427f9d84b8da2ab22cd1d4b Mon Sep 17 00:00:00 2001 +From: David Dreschner +Date: Thu, 12 Feb 2026 12:21:20 +0100 +Subject: [PATCH] fix: Fix deprecation warning on PHP >= 8.5 + +Signed-off-by: David Dreschner +--- + src/URL/Normalizer.php | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/URL/Normalizer.php b/src/URL/Normalizer.php +index 930f7b7..7dabf14 100755 +--- a/src/URL/Normalizer.php ++++ b/src/URL/Normalizer.php +@@ -83,7 +83,7 @@ class Normalizer + // parse URL into respective parts + $url_components = $this->mbParseUrl($this->url); + +- if (! $url_components) { ++ if (count($url_components) === 0) { + // Reset URL + $this->url = ''; + +@@ -356,7 +356,7 @@ class Normalizer + + private function mbParseUrl($url) + { +- $result = false; ++ $result = []; + + // Build arrays of values we need to decode before parsing + $entities = array('%21', '%2A', '%27', '%28', '%29', '%3B', '%3A', '%40', '%26', '%3D', '%24', '%2C', '%2F', '%3F', '%23', '%5B', '%5D'); +-- +2.43.0 + diff --git a/REUSE.toml b/REUSE.toml index 6ecbdb659a..c9d76e6f69 100644 --- a/REUSE.toml +++ b/REUSE.toml @@ -172,3 +172,9 @@ path = [".patches/dkimvalidator-fix-broken-canonical-handling.patch"] precedence = "aggregate" SPDX-FileCopyrightText = "angrychimp, Teon d.o.o. - Bostjan Skufca, Marcus Bointon" SPDX-License-Identifier = "MIT" + +[[annotations]] +path = [".patches/url-normalizer-fix-deprecation-warning-on-PHP-8.5.patch"] +precedence = "aggregate" +SPDX-FileCopyrightText = "2013 Glen Scott" +SPDX-License-Identifier = "MIT" diff --git a/composer.json b/composer.json index b9d8bdfd81..4ebaf306f1 100644 --- a/composer.json +++ b/composer.json @@ -18,14 +18,14 @@ "bamarni/composer-bin-plugin": "^1.8.3", "bytestream/horde-exception": "^2.2.0", "bytestream/horde-imap-client": "^2.33.6", - "bytestream/horde-mail": "^2.7.1", - "bytestream/horde-mime": "^2.13.2", + "bytestream/horde-mail": "^2.7.2", + "bytestream/horde-mime": "^2.14.0", "bytestream/horde-stream": "^1.7.2", "bytestream/horde-stringprep": "^1.2.1", "bytestream/horde-support": "^2.4.0", "bytestream/horde-text-filter": "^2.5.0", "bytestream/horde-text-flowed": "^2.1", - "bytestream/horde-util": "^2.8.0", + "bytestream/horde-util": "^2.8.1", "cerdic/css-tidy": "v2.2.1", "cweagans/composer-patches": "~2.0", "ezyang/htmlpurifier": "4.19.0", @@ -33,8 +33,8 @@ "gravatarphp/gravatar": "dev-master#6b9f6a45477ce48285738d9d0c3f0dbf97abe263", "hamza221/html2text": "^1.0", "jeremykendall/php-domain-parser": "^6.4.0", - "nextcloud/horde-managesieve": "^1.0", - "nextcloud/horde-smtp": "^1.0.2", + "nextcloud/horde-managesieve": "^1.0.1", + "nextcloud/horde-smtp": "^1.0.3", "nextcloud/kitinerary": "^1.0", "nextcloud/kitinerary-bin": "^1.0.4", "nextcloud/kitinerary-flatpak": "^1.0", diff --git a/composer.lock b/composer.lock index f14cbe75b4..f9be5bac58 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "58118b5d211447f560722687603b9e91", + "content-hash": "1bfa096a8f37087661d4065620d02ac2", "packages": [ { "name": "amphp/amp", @@ -933,16 +933,16 @@ }, { "name": "bytestream/horde-mail", - "version": "v2.7.1", + "version": "v2.7.2", "source": { "type": "git", "url": "https://github.com/bytestream/Mail.git", - "reference": "73f5798734caaf7c6aa3e7348ddc9e0d0b6a768e" + "reference": "5054666fe1a43f86a85e911111c115a133d80334" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/bytestream/Mail/zipball/73f5798734caaf7c6aa3e7348ddc9e0d0b6a768e", - "reference": "73f5798734caaf7c6aa3e7348ddc9e0d0b6a768e", + "url": "https://api.github.com/repos/bytestream/Mail/zipball/5054666fe1a43f86a85e911111c115a133d80334", + "reference": "5054666fe1a43f86a85e911111c115a133d80334", "shasum": "" }, "require": { @@ -982,22 +982,22 @@ "description": "Horde mail library", "homepage": "https://www.horde.org/libraries/Horde_Mail", "support": { - "source": "https://github.com/bytestream/Mail/tree/v2.7.1" + "source": "https://github.com/bytestream/Mail/tree/v2.7.2" }, - "time": "2022-05-23T09:07:13+00:00" + "time": "2026-02-12T11:00:50+00:00" }, { "name": "bytestream/horde-mime", - "version": "v2.13.2", + "version": "v2.14.0", "source": { "type": "git", "url": "https://github.com/bytestream/Mime.git", - "reference": "63eb21725983e437536d457135719df5a42e3cf4" + "reference": "5e5cfdecccf1db5db39df17028af00bb8e513b27" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/bytestream/Mime/zipball/63eb21725983e437536d457135719df5a42e3cf4", - "reference": "63eb21725983e437536d457135719df5a42e3cf4", + "url": "https://api.github.com/repos/bytestream/Mime/zipball/5e5cfdecccf1db5db39df17028af00bb8e513b27", + "reference": "5e5cfdecccf1db5db39df17028af00bb8e513b27", "shasum": "" }, "require": { @@ -1010,7 +1010,7 @@ "bytestream/horde-text-flowed": "^2", "bytestream/horde-translation": "^2.2", "bytestream/horde-util": "^2", - "php": "^7.4 || ^8.0" + "php": "^8.0" }, "require-dev": { "bytestream/horde-text-filter": "^2.4", @@ -1046,9 +1046,9 @@ "description": "MIME library", "homepage": "https://www.horde.org/libraries/Horde_Mime", "support": { - "source": "https://github.com/bytestream/Mime/tree/v2.13.2" + "source": "https://github.com/bytestream/Mime/tree/v2.14.0" }, - "time": "2024-08-12T14:10:09+00:00" + "time": "2026-02-12T14:39:44+00:00" }, { "name": "bytestream/horde-secret", @@ -1542,16 +1542,16 @@ }, { "name": "bytestream/horde-util", - "version": "v2.8.0", + "version": "v2.8.1", "source": { "type": "git", "url": "https://github.com/bytestream/Util.git", - "reference": "352b5aee46e2df0b85961c1bde47c03a6b440224" + "reference": "45a9c3c14e70eec9df5d117a2d4941b097872672" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/bytestream/Util/zipball/352b5aee46e2df0b85961c1bde47c03a6b440224", - "reference": "352b5aee46e2df0b85961c1bde47c03a6b440224", + "url": "https://api.github.com/repos/bytestream/Util/zipball/45a9c3c14e70eec9df5d117a2d4941b097872672", + "reference": "45a9c3c14e70eec9df5d117a2d4941b097872672", "shasum": "" }, "require": { @@ -1592,9 +1592,9 @@ "description": "Horde utility library", "homepage": "https://www.horde.org/libraries/Horde_Util", "support": { - "source": "https://github.com/bytestream/Util/tree/v2.8.0" + "source": "https://github.com/bytestream/Util/tree/v2.8.1" }, - "time": "2024-09-13T10:21:29+00:00" + "time": "2026-02-12T14:33:23+00:00" }, { "name": "cerdic/css-tidy", @@ -2152,16 +2152,16 @@ }, { "name": "nextcloud/horde-managesieve", - "version": "v1.0.0", + "version": "v1.0.1", "source": { "type": "git", "url": "https://github.com/nextcloud/horde-managesieve.git", - "reference": "fd81621064a4b4bef74aadeffa0e610d844314aa" + "reference": "722bbe9de54022e7102161ab1f34d8bb8b8ae9c7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nextcloud/horde-managesieve/zipball/fd81621064a4b4bef74aadeffa0e610d844314aa", - "reference": "fd81621064a4b4bef74aadeffa0e610d844314aa", + "url": "https://api.github.com/repos/nextcloud/horde-managesieve/zipball/722bbe9de54022e7102161ab1f34d8bb8b8ae9c7", + "reference": "722bbe9de54022e7102161ab1f34d8bb8b8ae9c7", "shasum": "" }, "require": { @@ -2198,22 +2198,22 @@ "description": "ManageSieve client library", "homepage": "https://www.horde.org", "support": { - "source": "https://github.com/nextcloud/horde-managesieve/tree/v1.0.0" + "source": "https://github.com/nextcloud/horde-managesieve/tree/v1.0.1" }, - "time": "2022-04-27T16:49:35+00:00" + "time": "2026-02-12T15:09:05+00:00" }, { "name": "nextcloud/horde-smtp", - "version": "v1.0.2", + "version": "v1.0.3", "source": { "type": "git", "url": "https://github.com/nextcloud/horde-smtp.git", - "reference": "29b9a574136a067a206def77078cacc8f6acf3e5" + "reference": "de5281cefd271b709ffd3b64c5bf3a755283042e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nextcloud/horde-smtp/zipball/29b9a574136a067a206def77078cacc8f6acf3e5", - "reference": "29b9a574136a067a206def77078cacc8f6acf3e5", + "url": "https://api.github.com/repos/nextcloud/horde-smtp/zipball/de5281cefd271b709ffd3b64c5bf3a755283042e", + "reference": "de5281cefd271b709ffd3b64c5bf3a755283042e", "shasum": "" }, "require": { @@ -2253,9 +2253,9 @@ "description": "Horde SMTP client", "homepage": "https://www.horde.org", "support": { - "source": "https://github.com/nextcloud/horde-smtp/tree/v1.0.2" + "source": "https://github.com/nextcloud/horde-smtp/tree/v1.0.3" }, - "time": "2022-12-14T16:39:58+00:00" + "time": "2026-02-09T17:25:55+00:00" }, { "name": "nextcloud/kitinerary", diff --git a/patches.json b/patches.json index 64546521bc..1562ee2148 100644 --- a/patches.json +++ b/patches.json @@ -1,5 +1,15 @@ { "patches": { + "glenscott/url-normalizer": [ + { + "description": "Fix to prevent deprecation warning when using PHP >= 8.5", + "url": ".patches/url-normalizer-fix-deprecation-warning-on-PHP-8.5.patch", + "sha256":"856c3bc4d3e883f86efc3a24946681a3a6e4c22afa67d7b8cb1d78391668c365", + "extra": { + "upstream-fix-url": "https://github.com/glenscott/url-normalizer/pull/33" + } + } + ], "phpmailer/dkimvalidator": [ { "description": "Fix incorrect canonicalization handling and modified message content", diff --git a/patches.lock.json b/patches.lock.json index 30344cb264..1c7d42e8aa 100644 --- a/patches.lock.json +++ b/patches.lock.json @@ -1,6 +1,19 @@ { - "_hash": "0e361a02397cd9d8d46e434d387c107639b0c9b7541b3f9446da4e3c90758e98", + "_hash": "e3297c923adcdbd735cc8da9765e21e3f6bcb9f669ed228d8954814d910fc127", "patches": { + "glenscott/url-normalizer": [ + { + "package": "glenscott/url-normalizer", + "description": "Fix to prevent deprecation warning when using PHP >= 8.5", + "url": ".patches/url-normalizer-fix-deprecation-warning-on-PHP-8.5.patch", + "sha256": "856c3bc4d3e883f86efc3a24946681a3a6e4c22afa67d7b8cb1d78391668c365", + "depth": 1, + "extra": { + "upstream-fix-url": "https://github.com/glenscott/url-normalizer/pull/33", + "provenance": "patches-file:patches.json" + } + } + ], "phpmailer/dkimvalidator": [ { "package": "phpmailer/dkimvalidator", diff --git a/tests/Unit/BackgroundJob/ContextChat/SubmitContentJobTest.php b/tests/Unit/BackgroundJob/ContextChat/SubmitContentJobTest.php index a4d0f21cc6..20ba81844e 100644 --- a/tests/Unit/BackgroundJob/ContextChat/SubmitContentJobTest.php +++ b/tests/Unit/BackgroundJob/ContextChat/SubmitContentJobTest.php @@ -60,6 +60,21 @@ class SubmitContentJobTest extends TestCase { /** @var ContextChatProvider */ private $contextChatProvider; + /** @var ITimeFactory|MockObject */ + private $time; + + /** @var IMAPClientFactory|MockObject */ + private $imapClientFactory; + + /** @var LoggerInterface|MockObject */ + private $logger; + + /** @var MailboxMapper|MockObject */ + private $mailboxMapper; + + /** @var SubmitContentJob */ + private $submitContentJob; + protected function setUp(): void { parent::setUp(); diff --git a/tests/Unit/Command/CreateAccountTest.php b/tests/Unit/Command/CreateAccountTest.php index 1b1acec5ba..9f523c8d83 100644 --- a/tests/Unit/Command/CreateAccountTest.php +++ b/tests/Unit/Command/CreateAccountTest.php @@ -21,6 +21,7 @@ class CreateAccountTest extends TestCase { private $service; private $crypto; private $userManager; + private $classificationSettingsService; private $command; private $args = [ 'user-id', diff --git a/tests/Unit/ContextChat/ContextChatProviderTest.php b/tests/Unit/ContextChat/ContextChatProviderTest.php index 83b15c2589..e9d9a449f3 100644 --- a/tests/Unit/ContextChat/ContextChatProviderTest.php +++ b/tests/Unit/ContextChat/ContextChatProviderTest.php @@ -51,6 +51,9 @@ class ContextChatProviderTest extends TestCase { /** @var IContentManager|MockObject */ private $contentManager; + /** @var IJobList|MockObject */ + private $jobList; + /** @var ContextChatProvider */ private $contextChatProvider; diff --git a/tests/Unit/Controller/MessagesControllerTest.php b/tests/Unit/Controller/MessagesControllerTest.php index a4eff2ae05..f0cbb969d7 100644 --- a/tests/Unit/Controller/MessagesControllerTest.php +++ b/tests/Unit/Controller/MessagesControllerTest.php @@ -518,11 +518,9 @@ public function testDownloadAttachments() { // Reflection is needed to get private properties $refZip = new ReflectionObject($zip); $prop = $refZip->getProperty('resources'); - $prop->setAccessible(true); $zipValues = $prop->getValue($zip); $refResponse = new ReflectionObject($response); $prop = $refResponse->getProperty('resources'); - $prop->setAccessible(true); $responseValues = $prop->getValue($zip); $this->assertTrue(is_resource($zipValues[0]['resource']));