Skip to content

Commit b6562e5

Browse files
Merge branch '4.4' into 5.0
* 4.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 [HttpKernel][FrameworkBundle] fix compat with Debug component [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 Track session usage when setting the token [4.4][MonologBridge] Fix $level type 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 [Security][Http][SwitchUserListener] Ignore all non existent username protection errors Add installation and minimal example to README
2 parents 2b9bd80 + a8254c1 commit b6562e5

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
@@ -23,7 +23,7 @@ class UrlValidator extends ConstraintValidator
2323
{
2424
const PATTERN = '~^
2525
(%s):// # protocol
26-
(([\_\.\pL\pN-]+:)?([\_\.\pL\pN-]+)@)? # basic auth
26+
(((?:[\_\.\pL\pN-]|%%[0-9A-Fa-f]{2})+:)?((?:[\_\.\pL\pN-]|%%[0-9A-Fa-f]{2})+)@)? # basic auth
2727
(
2828
([\pL\pN\pS\-\_\.])+(\.?([\pL\pN]|xn\-\-[\pL\pN-]+)+\.?) # a domain name
2929
| # 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
@@ -153,6 +153,8 @@ public function getValidUrls()
153153
['http://user.name:[email protected]'],
154154
['http://[email protected]'],
155155
['http://[email protected]'],
156+
['http://u%24er:[email protected]'],
157+
['http://user:pa%24%[email protected]'],
156158
['http://symfony.com?'],
157159
['http://symfony.com?query=1'],
158160
['http://symfony.com/?query=1'],
@@ -251,6 +253,8 @@ public function getInvalidUrls()
251253
['http://:password@@symfony.com'],
252254
['http://username:passwordsymfony.com'],
253255
['http://usern@me:[email protected]'],
256+
['http://nota%hex:[email protected]'],
257+
['http://username:nota%[email protected]'],
254258
['http://example.com/exploit.html?<script>alert(1);</script>'],
255259
['http://example.com/exploit.html?hel lo'],
256260
['http://example.com/exploit.html?not_a%hex'],

0 commit comments

Comments
 (0)