Skip to content

Commit e9a7026

Browse files
Merge branch '4.4' into 5.3
* 4.4: [Validator] Fix validation for single level domains Increased the reserved memory from 10k to 32k [DoctrineBridge] Add DbalLoggerTest to group legacy
2 parents bedd09f + 382cde2 commit e9a7026

File tree

7 files changed

+28
-7
lines changed

7 files changed

+28
-7
lines changed

.appveyor.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ init:
1212
- SET SYMFONY_DEPRECATIONS_HELPER=strict
1313
- SET ANSICON=121x90 (121x90)
1414
- SET SYMFONY_PHPUNIT_DISABLE_RESULT_CACHE=1
15-
- SET SYMFONY_DEPRECATIONS_HELPER=max[direct]=1
1615
- REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Command Processor" /v DelayedExpansion /t REG_DWORD /d 1 /f
1716

1817
install:

.github/workflows/integration-tests.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,6 @@ jobs:
157157
- name: Run tests
158158
run: ./phpunit --group integration -v
159159
env:
160-
SYMFONY_DEPRECATIONS_HELPER: max[direct]=1 # to be removed once DbalLogger is compatible with dbal 3.2+
161160
REDIS_HOST: localhost
162161
REDIS_CLUSTER_HOSTS: 'localhost:7000 localhost:7001 localhost:7002 localhost:7003 localhost:7004 localhost:7005'
163162
REDIS_SENTINEL_HOSTS: 'localhost:26379'

.github/workflows/unit-tests.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ jobs:
6363
echo COLUMNS=120 >> $GITHUB_ENV
6464
echo PHPUNIT="$(readlink -f ./phpunit) --exclude-group tty,benchmark,intl-data" >> $GITHUB_ENV
6565
echo COMPOSER_UP='composer update --no-progress --ansi' >> $GITHUB_ENV
66-
echo SYMFONY_DEPRECATIONS_HELPER=max[direct]=1 >> $GITHUB_ENV # to be removed once DbalLogger is compatible with dbal 3.2+
6766
6867
SYMFONY_VERSIONS=$(git ls-remote -q --heads | cut -f2 | grep -o '/[1-9][0-9]*\.[0-9].*' | sort -V)
6968
SYMFONY_VERSION=$(grep ' VERSION = ' src/Symfony/Component/HttpKernel/Kernel.php | grep -P -o '[0-9]+\.[0-9]+')

src/Symfony/Bridge/Doctrine/Tests/Logger/DbalLoggerTest.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
use Psr\Log\LoggerInterface;
1616
use Symfony\Bridge\Doctrine\Logger\DbalLogger;
1717

18+
/**
19+
* @group legacy
20+
*/
1821
class DbalLoggerTest extends TestCase
1922
{
2023
/**
@@ -46,8 +49,8 @@ public function getLogFixtures()
4649
['SQL', null, []],
4750
['SQL', [], []],
4851
['SQL', ['foo' => 'bar'], ['foo' => 'bar']],
49-
['SQL', ['foo' => "\x7F\xFF"], ['foo' => DbalLogger::BINARY_DATA_VALUE]],
50-
['SQL', ['foo' => "bar\x7F\xFF"], ['foo' => DbalLogger::BINARY_DATA_VALUE]],
52+
['SQL', ['foo' => "\x7F\xFF"], ['foo' => '(binary value)']],
53+
['SQL', ['foo' => "bar\x7F\xFF"], ['foo' => '(binary value)']],
5154
['SQL', ['foo' => ''], ['foo' => '']],
5255
];
5356
}

src/Symfony/Component/ErrorHandler/ErrorHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ class ErrorHandler
111111
public static function register(self $handler = null, bool $replace = true): self
112112
{
113113
if (null === self::$reservedMemory) {
114-
self::$reservedMemory = str_repeat('x', 10240);
114+
self::$reservedMemory = str_repeat('x', 32768);
115115
register_shutdown_function(__CLASS__.'::handleFatalError');
116116
}
117117

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,13 @@ class UrlValidator extends ConstraintValidator
2525
(%s):// # protocol
2626
(((?:[\_\.\pL\pN-]|%%[0-9A-Fa-f]{2})+:)?((?:[\_\.\pL\pN-]|%%[0-9A-Fa-f]{2})+)@)? # basic auth
2727
(
28-
([\pL\pN\pS\-\_]+\.)*(([\pL\pN]|xn\-\-[\pL\pN-]+)+\.?) # a domain name
28+
(?:
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
32+
|
33+
[a-z0-9\-\_]++ # a single-level domain name
34+
)\.?
2935
| # or
3036
\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3} # an IP address
3137
| # or

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,10 @@ public function getValidUrls()
123123
['http://very.long.domain.name.com/'],
124124
['http://localhost/'],
125125
['http://myhost123/'],
126+
['http://internal-api'],
127+
['http://internal-api.'],
128+
['http://internal-api/'],
129+
['http://internal-api/path'],
126130
['http://127.0.0.1/'],
127131
['http://127.0.0.1:80/'],
128132
['http://[::1]/'],
@@ -169,6 +173,7 @@ public function getValidUrls()
169173
['http://symfony.com/#fragment'],
170174
['http://symfony.com/#one_more%20test'],
171175
['http://example.com/exploit.html?hello[0]=test'],
176+
['http://বিডিআইএ.বাংলা'],
172177
];
173178
}
174179

@@ -254,7 +259,14 @@ public function getInvalidUrls()
254259
['http://127.0.0.1:aa/'],
255260
['ftp://[::1]/'],
256261
['http://[::1'],
262+
['http://☎'],
263+
['http://☎.'],
264+
['http://☎/'],
265+
['http://☎/path'],
266+
['http://hello.☎'],
267+
['http://hello.☎.'],
257268
['http://hello.☎/'],
269+
['http://hello.☎/path'],
258270
['http://:password@symfony.com'],
259271
['http://:password@@symfony.com'],
260272
['http://username:passwordsymfony.com'],
@@ -271,6 +283,9 @@ public function getInvalidUrls()
271283
['http://.m.example.com'],
272284
['http://wwww.example..com'],
273285
['http://.www.example.com'],
286+
['http://example.co-'],
287+
['http://example.co-/path'],
288+
['http:///path'],
274289
];
275290
}
276291

0 commit comments

Comments
 (0)