Skip to content

Commit 8f3d556

Browse files
tec: Add official support for PHP 8.4
1 parent c3ff13d commit 8f3d556

File tree

4 files changed

+8
-14
lines changed

4 files changed

+8
-14
lines changed

.github/workflows/linters.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
strategy:
1717
matrix:
1818
operating-system: [ubuntu-22.04]
19-
php-versions: ['8.2', '8.3']
19+
php-versions: ['8.2', '8.3', '8.4']
2020

2121
name: PHP ${{ matrix.php-versions }} CI on ${{ matrix.operating-system }}
2222

.github/workflows/tests.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
strategy:
2323
matrix:
2424
operating-system: [ubuntu-22.04]
25-
php-versions: ['8.2', '8.3']
25+
php-versions: ['8.2', '8.3', '8.4']
2626

2727
services:
2828
postgres:

.phpunit.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
</testsuite>
3535
</testsuites>
3636

37-
<source>
37+
<source ignoreIndirectDeprecations="true">
3838
<include>
3939
<directory suffix=".php">src</directory>
4040
<directory suffix=".php">lib/SpiderBits</directory>

lib/SpiderBits/src/Url.php

+5-11
Original file line numberDiff line numberDiff line change
@@ -131,27 +131,21 @@ public static function sanitize(string $url): string
131131
$host = trim($host, '.');
132132
$host = preg_replace('/\.{2,}/', '.', $host);
133133

134-
if ($host === null) {
135-
$host = '';
136-
}
137-
138134
// The host can be a valid integer ip address, we want to normalize it
139135
// to 4 dot-separated decimal values
140-
if (filter_var($host, FILTER_VALIDATE_INT) !== false) {
136+
if ($host && filter_var($host, FILTER_VALIDATE_INT) !== false) {
141137
$host = long2ip(intval($host));
142-
143-
if ($host === false) {
144-
$host = '';
145-
}
146138
}
147139

148140
// idn_to_ascii allows to transform an unicode hostname to an
149141
// ASCII representation
150142
// @see https://en.wikipedia.org/wiki/Punycode
151143
// It also lowercases the string.
152-
$host = idn_to_ascii($host, IDNA_DEFAULT, INTL_IDNA_VARIANT_UTS46);
144+
if ($host) {
145+
$host = idn_to_ascii($host, IDNA_DEFAULT, INTL_IDNA_VARIANT_UTS46);
146+
}
153147

154-
if ($host === false) {
148+
if (!$host) {
155149
$host = '';
156150
}
157151

0 commit comments

Comments
 (0)