Skip to content

Commit 059e483

Browse files
Merge branch '7.2' into 7.3
* 7.2: Update validators.pt.xlf bug #59196 [Config] ResourceCheckerConfigCache metadata unserialize emits warning fix(validator): only check for puny code in tld
2 parents b5f7d94 + 103f2cb commit 059e483

File tree

5 files changed

+13
-6
lines changed

5 files changed

+13
-6
lines changed

src/Symfony/Component/Config/ResourceCheckerConfigCache.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ public function write(string $content, ?array $metadata = null): void
127127

128128
$ser = preg_replace_callback('/;O:(\d+):"/', static fn ($m) => ';O:'.(9 + $m[1]).':"Tracking\\', $ser);
129129
$ser = preg_replace_callback('/s:(\d+):"\0[^\0]++\0/', static fn ($m) => 's:'.($m[1] - \strlen($m[0]) + 6).':"', $ser);
130-
$ser = unserialize($ser);
130+
$ser = unserialize($ser, ['allowed_classes' => false]);
131131
$ser = @json_encode($ser, \JSON_UNESCAPED_SLASHES | \JSON_UNESCAPED_UNICODE) ?: [];
132132
$ser = str_replace('"__PHP_Incomplete_Class_Name":"Tracking\\\\', '"@type":"', $ser);
133133
$ser = \sprintf('{"resources":%s}', $ser);

src/Symfony/Component/Form/Resources/translations/validators.pt.xlf

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
</trans-unit>
2525
<trans-unit id="101">
2626
<source>The selected choice is invalid.</source>
27-
<target>A escolha seleccionada é inválida.</target>
27+
<target>A escolha selecionada é inválida.</target>
2828
</trans-unit>
2929
<trans-unit id="102">
3030
<source>The collection is invalid.</source>

src/Symfony/Component/Mailer/Transport/Smtp/Stream/AbstractStream.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public function readLine(): string
8888
throw new TransportException(\sprintf('Connection to "%s" has been closed unexpectedly.', $this->getReadConnectionDescription()));
8989
}
9090
if (false === $line) {
91-
throw new TransportException(\sprintf('Unable to read from connection to "%s": ', $this->getReadConnectionDescription()).error_get_last()['message']);
91+
throw new TransportException(\sprintf('Unable to read from connection to "%s": ', $this->getReadConnectionDescription().error_get_last()['message'] ?? ''));
9292
}
9393
}
9494

src/Symfony/Component/Validator/Constraints/UrlValidator.php

+8-3
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,14 @@ class UrlValidator extends ConstraintValidator
2626
(((?:[\_\.\pL\pN-]|%%[0-9A-Fa-f]{2})+:)?((?:[\_\.\pL\pN-]|%%[0-9A-Fa-f]{2})+)@)? # basic auth
2727
(
2828
(?:
29-
(?:xn--[a-z0-9-]++\.)*+xn--[a-z0-9-]++ # a domain name using punycode
30-
|
31-
(?:[\pL\pN\pS\pM\-\_]++\.)+[\pL\pN\pM]++ # a multi-level domain name
29+
(?:
30+
(?:[\pL\pN\pS\pM\-\_]++\.)+
31+
(?:
32+
(?:xn--[a-z0-9-]++) # punycode in tld
33+
|
34+
(?:[\pL\pN\pM]++) # no punycode in tld
35+
)
36+
) # a multi-level domain name
3237
|
3338
[a-z0-9\-\_]++ # a single-level domain name
3439
)\.?

src/Symfony/Component/Validator/Tests/Constraints/UrlValidatorTest.php

+2
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,8 @@ public static function getValidUrls()
188188
['http://xn--e1afmkfd.xn--80akhbyknj4f.xn--e1afmkfd/'],
189189
['http://xn--espaa-rta.xn--ca-ol-fsay5a/'],
190190
['http://xn--d1abbgf6aiiy.xn--p1ai/'],
191+
['http://example.xn--p1ai/'],
192+
['http://xn--d1abbgf6aiiy.example.xn--p1ai/'],
191193
['http://☎.com/'],
192194
['http://username:password@symfony.com'],
193195
['http://user.name:password@symfony.com'],

0 commit comments

Comments
 (0)