Skip to content

Commit f3eb3d4

Browse files
authored
Merge pull request #12404 from nextcloud/fix/php85-deprecation-warnings
Fix deprecation warnings when using PHP >= 8.5
2 parents aac3836 + 6f33f46 commit f3eb3d4

File tree

10 files changed

+121
-40
lines changed

10 files changed

+121
-40
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
From 5b09c44ecfeb59756427f9d84b8da2ab22cd1d4b Mon Sep 17 00:00:00 2001
2+
From: David Dreschner <david.dreschner@nextcloud.com>
3+
Date: Thu, 12 Feb 2026 12:21:20 +0100
4+
Subject: [PATCH] fix: Fix deprecation warning on PHP >= 8.5
5+
6+
Signed-off-by: David Dreschner <david.dreschner@nextcloud.com>
7+
---
8+
src/URL/Normalizer.php | 4 ++--
9+
1 file changed, 2 insertions(+), 2 deletions(-)
10+
11+
diff --git a/src/URL/Normalizer.php b/src/URL/Normalizer.php
12+
index 930f7b7..7dabf14 100755
13+
--- a/src/URL/Normalizer.php
14+
+++ b/src/URL/Normalizer.php
15+
@@ -83,7 +83,7 @@ class Normalizer
16+
// parse URL into respective parts
17+
$url_components = $this->mbParseUrl($this->url);
18+
19+
- if (! $url_components) {
20+
+ if (count($url_components) === 0) {
21+
// Reset URL
22+
$this->url = '';
23+
24+
@@ -356,7 +356,7 @@ class Normalizer
25+
26+
private function mbParseUrl($url)
27+
{
28+
- $result = false;
29+
+ $result = [];
30+
31+
// Build arrays of values we need to decode before parsing
32+
$entities = array('%21', '%2A', '%27', '%28', '%29', '%3B', '%3A', '%40', '%26', '%3D', '%24', '%2C', '%2F', '%3F', '%23', '%5B', '%5D');
33+
--
34+
2.43.0
35+

REUSE.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,3 +172,9 @@ path = [".patches/dkimvalidator-fix-broken-canonical-handling.patch"]
172172
precedence = "aggregate"
173173
SPDX-FileCopyrightText = "angrychimp, Teon d.o.o. - Bostjan Skufca, Marcus Bointon"
174174
SPDX-License-Identifier = "MIT"
175+
176+
[[annotations]]
177+
path = [".patches/url-normalizer-fix-deprecation-warning-on-PHP-8.5.patch"]
178+
precedence = "aggregate"
179+
SPDX-FileCopyrightText = "2013 Glen Scott"
180+
SPDX-License-Identifier = "MIT"

composer.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,23 @@
1818
"bamarni/composer-bin-plugin": "^1.8.3",
1919
"bytestream/horde-exception": "^2.2.0",
2020
"bytestream/horde-imap-client": "^2.33.6",
21-
"bytestream/horde-mail": "^2.7.1",
22-
"bytestream/horde-mime": "^2.13.2",
21+
"bytestream/horde-mail": "^2.7.2",
22+
"bytestream/horde-mime": "^2.14.0",
2323
"bytestream/horde-stream": "^1.7.2",
2424
"bytestream/horde-stringprep": "^1.2.1",
2525
"bytestream/horde-support": "^2.4.0",
2626
"bytestream/horde-text-filter": "^2.5.0",
2727
"bytestream/horde-text-flowed": "^2.1",
28-
"bytestream/horde-util": "^2.8.0",
28+
"bytestream/horde-util": "^2.8.1",
2929
"cerdic/css-tidy": "v2.2.1",
3030
"cweagans/composer-patches": "~2.0",
3131
"ezyang/htmlpurifier": "4.19.0",
3232
"glenscott/url-normalizer": "^1.4",
3333
"gravatarphp/gravatar": "dev-master#6b9f6a45477ce48285738d9d0c3f0dbf97abe263",
3434
"hamza221/html2text": "^1.0",
3535
"jeremykendall/php-domain-parser": "^6.4.0",
36-
"nextcloud/horde-managesieve": "^1.0",
37-
"nextcloud/horde-smtp": "^1.0.2",
36+
"nextcloud/horde-managesieve": "^1.0.1",
37+
"nextcloud/horde-smtp": "^1.0.3",
3838
"nextcloud/kitinerary": "^1.0",
3939
"nextcloud/kitinerary-bin": "^1.0.4",
4040
"nextcloud/kitinerary-flatpak": "^1.0",

composer.lock

Lines changed: 32 additions & 32 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

patches.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
{
22
"patches": {
3+
"glenscott/url-normalizer": [
4+
{
5+
"description": "Fix to prevent deprecation warning when using PHP >= 8.5",
6+
"url": ".patches/url-normalizer-fix-deprecation-warning-on-PHP-8.5.patch",
7+
"sha256":"856c3bc4d3e883f86efc3a24946681a3a6e4c22afa67d7b8cb1d78391668c365",
8+
"extra": {
9+
"upstream-fix-url": "https://github.com/glenscott/url-normalizer/pull/33"
10+
}
11+
}
12+
],
313
"phpmailer/dkimvalidator": [
414
{
515
"description": "Fix incorrect canonicalization handling and modified message content",

patches.lock.json

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
11
{
2-
"_hash": "0e361a02397cd9d8d46e434d387c107639b0c9b7541b3f9446da4e3c90758e98",
2+
"_hash": "e3297c923adcdbd735cc8da9765e21e3f6bcb9f669ed228d8954814d910fc127",
33
"patches": {
4+
"glenscott/url-normalizer": [
5+
{
6+
"package": "glenscott/url-normalizer",
7+
"description": "Fix to prevent deprecation warning when using PHP >= 8.5",
8+
"url": ".patches/url-normalizer-fix-deprecation-warning-on-PHP-8.5.patch",
9+
"sha256": "856c3bc4d3e883f86efc3a24946681a3a6e4c22afa67d7b8cb1d78391668c365",
10+
"depth": 1,
11+
"extra": {
12+
"upstream-fix-url": "https://github.com/glenscott/url-normalizer/pull/33",
13+
"provenance": "patches-file:patches.json"
14+
}
15+
}
16+
],
417
"phpmailer/dkimvalidator": [
518
{
619
"package": "phpmailer/dkimvalidator",

tests/Unit/BackgroundJob/ContextChat/SubmitContentJobTest.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,21 @@ class SubmitContentJobTest extends TestCase {
6060
/** @var ContextChatProvider */
6161
private $contextChatProvider;
6262

63+
/** @var ITimeFactory|MockObject */
64+
private $time;
65+
66+
/** @var IMAPClientFactory|MockObject */
67+
private $imapClientFactory;
68+
69+
/** @var LoggerInterface|MockObject */
70+
private $logger;
71+
72+
/** @var MailboxMapper|MockObject */
73+
private $mailboxMapper;
74+
75+
/** @var SubmitContentJob */
76+
private $submitContentJob;
77+
6378
protected function setUp(): void {
6479
parent::setUp();
6580

tests/Unit/Command/CreateAccountTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ class CreateAccountTest extends TestCase {
2121
private $service;
2222
private $crypto;
2323
private $userManager;
24+
private $classificationSettingsService;
2425
private $command;
2526
private $args = [
2627
'user-id',

tests/Unit/ContextChat/ContextChatProviderTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ class ContextChatProviderTest extends TestCase {
5151
/** @var IContentManager|MockObject */
5252
private $contentManager;
5353

54+
/** @var IJobList|MockObject */
55+
private $jobList;
56+
5457
/** @var ContextChatProvider */
5558
private $contextChatProvider;
5659

tests/Unit/Controller/MessagesControllerTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -518,11 +518,9 @@ public function testDownloadAttachments() {
518518
// Reflection is needed to get private properties
519519
$refZip = new ReflectionObject($zip);
520520
$prop = $refZip->getProperty('resources');
521-
$prop->setAccessible(true);
522521
$zipValues = $prop->getValue($zip);
523522
$refResponse = new ReflectionObject($response);
524523
$prop = $refResponse->getProperty('resources');
525-
$prop->setAccessible(true);
526524
$responseValues = $prop->getValue($zip);
527525

528526
$this->assertTrue(is_resource($zipValues[0]['resource']));

0 commit comments

Comments
 (0)