Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 0235a07

Browse filesBrowse files
Merge branch '6.0' into 6.1
* 6.0: [Mailer] fix tests [HttpFoundation] Prevent PHP Warning: Session ID is too long or contains illegal characters [Messenger] fix test [Messenger] Ceil waiting time when multiplier is a float on retry Spaces in system temp folder path cause deprecation errors in php 8
2 parents c4d1c57 + 525df54 commit 0235a07
Copy full SHA for 0235a07

File tree

6 files changed

+14
-9
lines changed
Filter options

6 files changed

+14
-9
lines changed

‎src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,7 @@ private function shouldEnableEntityLoader(): bool
683683
});
684684
$schema = '<?xml version="1.0" encoding="utf-8"?>
685685
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
686-
<xsd:include schemaLocation="file:///'.str_replace('\\', '/', $tmpfile).'" />
686+
<xsd:include schemaLocation="file:///'.rawurlencode(str_replace('\\', '/', $tmpfile)).'" />
687687
</xsd:schema>';
688688
file_put_contents($tmpfile, '<?xml version="1.0" encoding="utf-8"?>
689689
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">

‎src/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ public function start(): bool
136136
}
137137

138138
$sessionId = $_COOKIE[session_name()] ?? null;
139-
if ($sessionId && $this->saveHandler instanceof AbstractProxy && 'files' === $this->saveHandler->getSaveHandlerName() && !preg_match('/^[a-zA-Z0-9,-]{22,}$/', $sessionId)) {
139+
if ($sessionId && $this->saveHandler instanceof AbstractProxy && 'files' === $this->saveHandler->getSaveHandlerName() && !preg_match('/^[a-zA-Z0-9,-]{22,250}$/', $sessionId)) {
140140
// the session ID in the header is invalid, create a new one
141141
session_id(session_create_id());
142142
}

‎src/Symfony/Component/HttpFoundation/Tests/Session/Storage/NativeSessionStorageTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpFoundation/Tests/Session/Storage/NativeSessionStorageTest.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ public function testRegenerateInvalidSessionIdForNativeFileSessionHandler()
292292
$started = $storage->start();
293293

294294
$this->assertTrue($started);
295-
$this->assertMatchesRegularExpression('/^[a-zA-Z0-9,-]{22,}$/', session_id());
295+
$this->assertMatchesRegularExpression('/^[a-zA-Z0-9,-]{22,250}$/', session_id());
296296
$storage->save();
297297

298298
$_COOKIE[session_name()] = '&~[';
@@ -301,7 +301,7 @@ public function testRegenerateInvalidSessionIdForNativeFileSessionHandler()
301301
$started = $storage->start();
302302

303303
$this->assertTrue($started);
304-
$this->assertMatchesRegularExpression('/^[a-zA-Z0-9,-]{22,}$/', session_id());
304+
$this->assertMatchesRegularExpression('/^[a-zA-Z0-9,-]{22,250}$/', session_id());
305305
$storage->save();
306306

307307
$_COOKIE[session_name()] = '&~[';

‎src/Symfony/Component/Mailer/Transport/NativeTransportFactory.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Mailer/Transport/NativeTransportFactory.php
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function create(Dsn $dsn): TransportInterface
2929
throw new UnsupportedSchemeException($dsn, 'native', $this->getSupportedSchemes());
3030
}
3131

32-
if ($sendMailPath = \ini_get('sendmail_path')) {
32+
if ($sendMailPath = ini_get('sendmail_path')) {
3333
return new SendmailTransport($sendMailPath, $this->dispatcher, $this->logger);
3434
}
3535

@@ -39,8 +39,8 @@ public function create(Dsn $dsn): TransportInterface
3939

4040
// Only for windows hosts; at this point non-windows
4141
// host have already thrown an exception or returned a transport
42-
$host = \ini_get('SMTP');
43-
$port = (int) \ini_get('smtp_port');
42+
$host = ini_get('SMTP');
43+
$port = (int) ini_get('smtp_port');
4444

4545
if (!$host || !$port) {
4646
throw new TransportException('smtp or smtp_port is not configured in php.ini.');

‎src/Symfony/Component/Messenger/Retry/MultiplierRetryStrategy.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Messenger/Retry/MultiplierRetryStrategy.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,6 @@ public function getWaitingTime(Envelope $message, \Throwable $throwable = null):
8686
return $this->maxDelayMilliseconds;
8787
}
8888

89-
return $delay;
89+
return (int) ceil($delay);
9090
}
9191
}

‎src/Symfony/Component/Messenger/Tests/Retry/MultiplierRetryStrategyTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Messenger/Tests/Retry/MultiplierRetryStrategyTest.php
+6-1Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function testIsRetryableWithNoStamp()
5252
/**
5353
* @dataProvider getWaitTimeTests
5454
*/
55-
public function testGetWaitTime(int $delay, int $multiplier, int $maxDelay, int $previousRetries, int $expectedDelay)
55+
public function testGetWaitTime(int $delay, float $multiplier, int $maxDelay, int $previousRetries, int $expectedDelay)
5656
{
5757
$strategy = new MultiplierRetryStrategy(10, $delay, $multiplier, $maxDelay);
5858
$envelope = new Envelope(new \stdClass(), [new RedeliveryStamp($previousRetries)]);
@@ -83,5 +83,10 @@ public function getWaitTimeTests(): iterable
8383
// never a delay
8484
yield [0, 2, 10000, 0, 0];
8585
yield [0, 2, 10000, 1, 0];
86+
87+
// Float delay
88+
yield [1000, 1.5555, 5000, 0, 1000];
89+
yield [1000, 1.5555, 5000, 1, 1556];
90+
yield [1000, 1.5555, 5000, 2, 2420];
8691
}
8792
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.