Skip to content

Commit a8254c1

Browse files
Merge branch '3.4' into 4.4
* 3.4: [PropertyAccess] fix tests [WebProfilerBundle] fix test remove assertions that can never be reached [PropertyAccess] Improve message of unitialized property in php 7.4 [HttpFoundation] Fixed session migration with custom cookie lifetime [Serializer] Remove unused variable Allow URL-encoded special characters in basic auth part of URLs [Serializer] Fix unitialized properties (from PHP 7.4.2) when serializing context for the cache key [Validator] Add missing Ukrainian and Russian translations No need to reconnect the bags to the session Support for Content Security Policy style-src-elem and script-src-elem in WebProfiler [PropertyInfo][ReflectionExtractor] Check the array mutator prefixes last when the property is singular
2 parents adffe0c + adab212 commit a8254c1

File tree

4 files changed

+33
-1
lines changed

4 files changed

+33
-1
lines changed

Constraints/UrlValidator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class UrlValidator extends ConstraintValidator
2424
{
2525
const PATTERN = '~^
2626
(%s):// # protocol
27-
(([\_\.\pL\pN-]+:)?([\_\.\pL\pN-]+)@)? # basic auth
27+
(((?:[\_\.\pL\pN-]|%%[0-9A-Fa-f]{2})+:)?((?:[\_\.\pL\pN-]|%%[0-9A-Fa-f]{2})+)@)? # basic auth
2828
(
2929
([\pL\pN\pS\-\_\.])+(\.?([\pL\pN]|xn\-\-[\pL\pN-]+)+\.?) # a domain name
3030
| # or

Resources/translations/validators.ru.xlf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,18 @@
370370
<source>This value is not a valid hostname.</source>
371371
<target>Значение не является корректным именем хоста.</target>
372372
</trans-unit>
373+
<trans-unit id="96">
374+
<source>The number of elements in this collection should be a multiple of {{ compared_value }}.</source>
375+
<target>Количество элементов в этой коллекции должно быть кратным {{ compared_value }}.</target>
376+
</trans-unit>
377+
<trans-unit id="97">
378+
<source>This value should satisfy at least one of the following constraints:</source>
379+
<target>Значение должно удовлетворять как минимум одному из следующих ограничений:</target>
380+
</trans-unit>
381+
<trans-unit id="98">
382+
<source>Each element of this collection should satisfy its own set of constraints.</source>
383+
<target>Каждый элемент этой коллекции должен удовлетворять своему собственному набору ограничений.</target>
384+
</trans-unit>
373385
</body>
374386
</file>
375387
</xliff>

Resources/translations/validators.uk.xlf

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,22 @@
366366
<source>This value should be between {{ min }} and {{ max }}.</source>
367367
<target>Значення має бути між {{ min }} та {{ max }}.</target>
368368
</trans-unit>
369+
<trans-unit id="95">
370+
<source>This value is not a valid hostname.</source>
371+
<target>Значення не є дійсним іменем хоста.</target>
372+
</trans-unit>
373+
<trans-unit id="96">
374+
<source>The number of elements in this collection should be a multiple of {{ compared_value }}.</source>
375+
<target>Кількість елементів у цій колекції повинна бути кратною {{ compared_value }}.</target>
376+
</trans-unit>
377+
<trans-unit id="97">
378+
<source>This value should satisfy at least one of the following constraints:</source>
379+
<target>Значення повинно задовольняти хоча б одному з наступних обмежень:</target>
380+
</trans-unit>
381+
<trans-unit id="98">
382+
<source>Each element of this collection should satisfy its own set of constraints.</source>
383+
<target>Кожен елемент цієї колекції повинен задовольняти власному набору обмежень.</target>
384+
</trans-unit>
369385
</body>
370386
</file>
371387
</xliff>

Tests/Constraints/UrlValidatorTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,8 @@ public function getValidUrls()
157157
['http://user.name:[email protected]'],
158158
['http://[email protected]'],
159159
['http://[email protected]'],
160+
['http://u%24er:[email protected]'],
161+
['http://user:pa%24%[email protected]'],
160162
['http://symfony.com?'],
161163
['http://symfony.com?query=1'],
162164
['http://symfony.com/?query=1'],
@@ -255,6 +257,8 @@ public function getInvalidUrls()
255257
['http://:password@@symfony.com'],
256258
['http://username:passwordsymfony.com'],
257259
['http://usern@me:[email protected]'],
260+
['http://nota%hex:[email protected]'],
261+
['http://username:nota%[email protected]'],
258262
['http://example.com/exploit.html?<script>alert(1);</script>'],
259263
['http://example.com/exploit.html?hel lo'],
260264
['http://example.com/exploit.html?not_a%hex'],

0 commit comments

Comments
 (0)