Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9e1c1d8

Browse files
Merge branch '5.4' into 6.2
* 5.4: [Validator] Add missing validator translations in Polish language [HttpClient] Fix encoding some characters in query strings [FrameworkBundle] Ignore missing directories in about command Revert "[Messenger] Respect `isRetryable` decision of the retry strategy when deciding if failed message should be re-delivered"
2 parents b538289 + cc42fa7 commit 9e1c1d8

File tree

6 files changed

+35
-32
lines changed

6 files changed

+35
-32
lines changed

src/Symfony/Bundle/FrameworkBundle/Command/AboutCommand.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,10 @@ private static function formatFileSize(string $path): string
101101
if (is_file($path)) {
102102
$size = filesize($path) ?: 0;
103103
} else {
104+
if (!is_dir($path)) {
105+
return 'n/a';
106+
}
107+
104108
$size = 0;
105109
foreach (new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($path, \RecursiveDirectoryIterator::SKIP_DOTS | \RecursiveDirectoryIterator::FOLLOW_SYMLINKS)) as $file) {
106110
if ($file->isReadable()) {

src/Symfony/Component/HttpClient/HttpClientTrait.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ private static function parseUrl(string $url, array $query = [], array $allowedS
540540
}
541541

542542
// https://tools.ietf.org/html/rfc3986#section-3.3
543-
$parts[$part] = preg_replace_callback("#[^-A-Za-z0-9._~!$&/'()[\]*+,;=:@\\\\^`{|}%]++#", function ($m) { return rawurlencode($m[0]); }, $parts[$part]);
543+
$parts[$part] = preg_replace_callback("#[^-A-Za-z0-9._~!$&/'()[\]*+,;=:@{}%]++#", function ($m) { return rawurlencode($m[0]); }, $parts[$part]);
544544
}
545545

546546
return [
@@ -627,11 +627,7 @@ private static function mergeQueryString(?string $queryString, array $queryArray
627627
'%3B' => ';',
628628
'%40' => '@',
629629
'%5B' => '[',
630-
'%5C' => '\\',
631630
'%5D' => ']',
632-
'%5E' => '^',
633-
'%60' => '`',
634-
'%7C' => '|',
635631
]);
636632
}
637633

src/Symfony/Component/HttpClient/Tests/HttpClientTraitTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,12 +174,13 @@ public static function provideParseUrl(): iterable
174174
yield [['http:', '//example.com', null, null, null], 'http://Example.coM:80'];
175175
yield [['https:', '//xn--dj-kia8a.example.com:8000', '/', null, null], 'https://DÉjà.Example.com:8000/'];
176176
yield [[null, null, '/f%20o.o', '?a=b', '#c'], '/f o%2Eo?a=b#c'];
177+
yield [[null, null, '/custom%7C2010-01-01%2000:00:00%7C2023-06-15%2005:50:35', '?a=b', '#c'], '/custom|2010-01-01 00:00:00|2023-06-15 05:50:35?a=b#c'];
177178
yield [[null, '//a:b@foo', '/bar', null, null], '//a:b@foo/bar'];
178179
yield [[null, '//a:b@foo', '/b{}', null, null], '//a:b@foo/b{}'];
179180
yield [['http:', null, null, null, null], 'http:'];
180181
yield [['http:', null, 'bar', null, null], 'http:bar'];
181182
yield [[null, null, 'bar', '?a=1&c=c', null], 'bar?a=a&b=b', ['b' => null, 'c' => 'c', 'a' => 1]];
182-
yield [[null, null, 'bar', '?a=b+c&b=b-._~!$%26/%27()[]*%2B%2C;%3D:@%25\\^`%7B|%7D', null], 'bar?a=b+c', ['b' => 'b-._~!$&/\'()[]*+,;=:@%\\^`{|}']];
183+
yield [[null, null, 'bar', '?a=b+c&b=b-._~!$%26/%27()[]*%2B%2C;%3D:@%25%5C%5E%60%7B%7C%7D', null], 'bar?a=b+c', ['b' => 'b-._~!$&/\'()[]*+,;=:@%\\^`{|}']];
183184
yield [[null, null, 'bar', '?a=b%2B%20c', null], 'bar?a=b+c', ['a' => 'b+ c']];
184185
yield [[null, null, 'bar', '?a[b]=c', null], 'bar', ['a' => ['b' => 'c']]];
185186
yield [[null, null, 'bar', '?a[b[c]=d', null], 'bar?a[b[c]=d', []];

src/Symfony/Component/Messenger/EventListener/SendFailedMessageForRetryListener.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,7 @@ public static function getSubscribedEvents(): array
117117

118118
private function shouldRetry(\Throwable $e, Envelope $envelope, RetryStrategyInterface $retryStrategy): bool
119119
{
120-
$isRetryable = $retryStrategy->isRetryable($envelope, $e);
121-
if ($isRetryable && $e instanceof RecoverableExceptionInterface) {
120+
if ($e instanceof RecoverableExceptionInterface) {
122121
return true;
123122
}
124123

@@ -127,7 +126,7 @@ private function shouldRetry(\Throwable $e, Envelope $envelope, RetryStrategyInt
127126
if ($e instanceof HandlerFailedException) {
128127
$shouldNotRetry = true;
129128
foreach ($e->getNestedExceptions() as $nestedException) {
130-
if ($isRetryable && $nestedException instanceof RecoverableExceptionInterface) {
129+
if ($nestedException instanceof RecoverableExceptionInterface) {
131130
return true;
132131
}
133132

@@ -145,7 +144,7 @@ private function shouldRetry(\Throwable $e, Envelope $envelope, RetryStrategyInt
145144
return false;
146145
}
147146

148-
return $isRetryable;
147+
return $retryStrategy->isRetryable($envelope, $e);
149148
}
150149

151150
private function getRetryStrategyForTransport(string $alias): ?RetryStrategyInterface

src/Symfony/Component/Messenger/Tests/EventListener/SendFailedMessageForRetryListenerTest.php

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public function testRecoverableStrategyCausesRetry()
6363
$senderLocator->expects($this->once())->method('has')->willReturn(true);
6464
$senderLocator->expects($this->once())->method('get')->willReturn($sender);
6565
$retryStategy = $this->createMock(RetryStrategyInterface::class);
66-
$retryStategy->expects($this->once())->method('isRetryable')->willReturn(true);
66+
$retryStategy->expects($this->never())->method('isRetryable');
6767
$retryStategy->expects($this->once())->method('getWaitingTime')->willReturn(1000);
6868
$retryStrategyLocator = $this->createMock(ContainerInterface::class);
6969
$retryStrategyLocator->expects($this->once())->method('has')->willReturn(true);
@@ -78,27 +78,6 @@ public function testRecoverableStrategyCausesRetry()
7878
$listener->onMessageFailed($event);
7979
}
8080

81-
public function testRetryIsOnlyAllowedWhenPermittedByRetryStrategy()
82-
{
83-
$senderLocator = $this->createMock(ContainerInterface::class);
84-
$senderLocator->expects($this->never())->method('has');
85-
$senderLocator->expects($this->never())->method('get');
86-
$retryStrategy = $this->createMock(RetryStrategyInterface::class);
87-
$retryStrategy->expects($this->once())->method('isRetryable')->willReturn(false);
88-
$retryStrategy->expects($this->never())->method('getWaitingTime');
89-
$retryStrategyLocator = $this->createMock(ContainerInterface::class);
90-
$retryStrategyLocator->expects($this->once())->method('has')->willReturn(true);
91-
$retryStrategyLocator->expects($this->once())->method('get')->willReturn($retryStrategy);
92-
93-
$listener = new SendFailedMessageForRetryListener($senderLocator, $retryStrategyLocator);
94-
95-
$exception = new RecoverableMessageHandlingException('retry');
96-
$envelope = new Envelope(new \stdClass());
97-
$event = new WorkerMessageFailedEvent($envelope, 'my_receiver', $exception);
98-
99-
$listener->onMessageFailed($event);
100-
}
101-
10281
public function testEnvelopeIsSentToTransportOnRetry()
10382
{
10483
$exception = new \Exception('no!');

src/Symfony/Component/Validator/Resources/translations/validators.pl.xlf

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,30 @@
402402
<source>The value of the netmask should be between {{ min }} and {{ max }}.</source>
403403
<target>Wartość maski podsieci powinna być pomiędzy {{ min }} i {{ max }}.</target>
404404
</trans-unit>
405+
<trans-unit id="104">
406+
<source>The filename is too long. It should have {{ filename_max_length }} character or less.|The filename is too long. It should have {{ filename_max_length }} characters or less.</source>
407+
<target>Nazwa pliku jest za długa. Powinna mieć {{ filename_max_length }} znak lub mniej.|Nazwa pliku jest za długa. Powinna mieć {{ filename_max_length }} znaków lub mniej.</target>
408+
</trans-unit>
409+
<trans-unit id="105">
410+
<source>The password strength is too low. Please use a stronger password.</source>
411+
<target>Siła hasła jest zbyt niska. Użyj mocniejszego hasła.</target>
412+
</trans-unit>
413+
<trans-unit id="106">
414+
<source>This value contains characters that are not allowed by the current restriction-level.</source>
415+
<target>Ta wartość zawiera znaki, które nie są dozwolone przez aktualny poziom ograniczeń.</target>
416+
</trans-unit>
417+
<trans-unit id="107">
418+
<source>Using invisible characters is not allowed.</source>
419+
<target>Używanie niewidzialnych znaków jest niedozwolone.</target>
420+
</trans-unit>
421+
<trans-unit id="108">
422+
<source>Mixing numbers from different scripts is not allowed.</source>
423+
<target>Mieszanie liczb z różnych skryptów jest niedozwolone.</target>
424+
</trans-unit>
425+
<trans-unit id="109">
426+
<source>Using hidden overlay characters is not allowed.</source>
427+
<target>Używanie ukrytych znaków nakładki jest niedozwolone.</target>
428+
</trans-unit>
405429
</body>
406430
</file>
407431
</xliff>

0 commit comments

Comments
 (0)