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

Skip to content

Commit 2044ba8

Browse files
Merge branch '4.3' into 4.4
* 4.3: [Intl] Update the ICU data to 65.1 (4.3 branch) Replace deprecated calls in tests [Intl] Update the ICU data to 65.1 Delete 5_Security_issue.md [DI] Whitelist validator.auto_mapper in UnusedTagsPass [HttpClient] Fixed #33832 NO_PROXY option ignored in NativeHttpClient::request() method [Cache] give 100ms before starting the expiration countdown [Cache] fix logger usage in CacheTrait::doGet() [VarDumper] fix dumping uninitialized SplFileInfo Added missing translations. Fixed invalid changelog 4.0.0 for VarDumper Fixed invalid VarDumper upgrade doc. [HttpFoundation] Check if data passed to SessionBagProxy::initialize is an array Don't let falsey usernames slip through
2 parents 80f545b + 2e92ffe commit 2044ba8

File tree

1,143 files changed

+9292
-6632
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,143 files changed

+9292
-6632
lines changed

.github/ISSUE_TEMPLATE/5_Security_issue.md

Lines changed: 0 additions & 13 deletions
This file was deleted.

UPGRADE-4.0.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -924,7 +924,7 @@ Validator
924924
VarDumper
925925
---------
926926

927-
* The `VarDumperTestTrait::assertDumpEquals()` method expects a 3rd `$context = null`
927+
* The `VarDumperTestTrait::assertDumpEquals()` method expects a 3rd `$filter = 0`
928928
argument and moves `$message = ''` argument at 4th position.
929929

930930
Before:
@@ -939,7 +939,7 @@ VarDumper
939939
VarDumperTestTrait::assertDumpEquals($dump, $data, $filter = 0, $message = '');
940940
```
941941

942-
* The `VarDumperTestTrait::assertDumpMatchesFormat()` method expects a 3rd `$context = null`
942+
* The `VarDumperTestTrait::assertDumpMatchesFormat()` method expects a 3rd `$filter = 0`
943943
argument and moves `$message = ''` argument at 4th position.
944944

945945
Before:

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/UnusedTagsPass.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ class UnusedTagsPass implements CompilerPassInterface
6565
'twig.loader',
6666
'validator.constraint_validator',
6767
'validator.initializer',
68+
'validator.auto_mapper',
6869
];
6970

7071
public function process(ContainerBuilder $container)

src/Symfony/Component/Cache/Adapter/AbstractAdapter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,15 @@ static function ($deferred, $namespace, &$expiredIds) use ($getId) {
7676
$key = (string) $key;
7777
if (null === $item->expiry) {
7878
$ttl = 0 < $item->defaultLifetime ? $item->defaultLifetime : 0;
79-
} elseif (0 >= $ttl = (int) ($item->expiry - $now)) {
79+
} elseif (0 >= $ttl = (int) (0.1 + $item->expiry - $now)) {
8080
$expiredIds[] = $getId($key);
8181
continue;
8282
}
8383
if (isset(($metadata = $item->newMetadata)[CacheItem::METADATA_TAGS])) {
8484
unset($metadata[CacheItem::METADATA_TAGS]);
8585
}
8686
// For compactness, expiry and creation duration are packed in the key of an array, using magic numbers as separators
87-
$byLifetime[$ttl][$getId($key)] = $metadata ? ["\x9D".pack('VN', (int) $metadata[CacheItem::METADATA_EXPIRY] - CacheItem::METADATA_EXPIRY_OFFSET, $metadata[CacheItem::METADATA_CTIME])."\x5F" => $item->value] : $item->value;
87+
$byLifetime[$ttl][$getId($key)] = $metadata ? ["\x9D".pack('VN', (int) (0.1 + $metadata[self::METADATA_EXPIRY] - self::METADATA_EXPIRY_OFFSET), $metadata[self::METADATA_CTIME])."\x5F" => $item->value] : $item->value;
8888
}
8989

9090
return $byLifetime;

src/Symfony/Component/Cache/Adapter/AbstractTagAwareAdapter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ static function ($deferred, &$expiredIds) use ($getId, $tagPrefix) {
8181
$key = (string) $key;
8282
if (null === $item->expiry) {
8383
$ttl = 0 < $item->defaultLifetime ? $item->defaultLifetime : 0;
84-
} elseif (0 >= $ttl = (int) ($item->expiry - $now)) {
84+
} elseif (0 >= $ttl = (int) (0.1 + $item->expiry - $now)) {
8585
$expiredIds[] = $getId($key);
8686
continue;
8787
}
@@ -95,7 +95,7 @@ static function ($deferred, &$expiredIds) use ($getId, $tagPrefix) {
9595

9696
if ($metadata) {
9797
// For compactness, expiry and creation duration are packed, using magic numbers as separators
98-
$value['meta'] = pack('VN', (int) $metadata[CacheItem::METADATA_EXPIRY] - CacheItem::METADATA_EXPIRY_OFFSET, $metadata[CacheItem::METADATA_CTIME]);
98+
$value['meta'] = pack('VN', (int) (0.1 + $metadata[self::METADATA_EXPIRY] - self::METADATA_EXPIRY_OFFSET), $metadata[self::METADATA_CTIME]);
9999
}
100100

101101
// Extract tag changes, these should be removed from values in doSave()

src/Symfony/Component/Cache/Adapter/ProxyAdapter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ static function (CacheItemInterface $innerItem, array $item) {
8484
}
8585
if ($metadata) {
8686
// For compactness, expiry and creation duration are packed in the key of an array, using magic numbers as separators
87-
$item["\0*\0value"] = ["\x9D".pack('VN', (int) $metadata[CacheItem::METADATA_EXPIRY] - CacheItem::METADATA_EXPIRY_OFFSET, $metadata[CacheItem::METADATA_CTIME])."\x5F" => $item["\0*\0value"]];
87+
$item["\0*\0value"] = ["\x9D".pack('VN', (int) (0.1 + $metadata[self::METADATA_EXPIRY] - self::METADATA_EXPIRY_OFFSET), $metadata[self::METADATA_CTIME])."\x5F" => $item["\0*\0value"]];
8888
}
8989
$innerItem->set($item["\0*\0value"]);
9090
$innerItem->expiresAt(null !== $item["\0*\0expiry"] ? \DateTime::createFromFormat('U.u', sprintf('%.6f', $item["\0*\0expiry"])) : null);

src/Symfony/Component/Cache/Psr16Cache.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ public function getMultiple($keys, $default = null)
177177
unset($metadata[CacheItem::METADATA_TAGS]);
178178

179179
if ($metadata) {
180-
$values[$key] = ["\x9D".pack('VN', (int) $metadata[CacheItem::METADATA_EXPIRY] - self::METADATA_EXPIRY_OFFSET, $metadata[CacheItem::METADATA_CTIME])."\x5F" => $values[$key]];
180+
$values[$key] = ["\x9D".pack('VN', (int) (0.1 + $metadata[CacheItem::METADATA_EXPIRY] - self::METADATA_EXPIRY_OFFSET), $metadata[CacheItem::METADATA_CTIME])."\x5F" => $values[$key]];
181181
}
182182
}
183183

src/Symfony/Component/Cache/Tests/Adapter/AdapterTestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public function testGetMetadata()
109109
$cache->deleteItem('foo');
110110
$cache->get('foo', function ($item) {
111111
$item->expiresAfter(10);
112-
sleep(1);
112+
usleep(999000);
113113

114114
return 'bar';
115115
});

src/Symfony/Component/Cache/Traits/ContractsTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ private function doGet(AdapterInterface $pool, string $key, callable $callback,
6161
static function (CacheItem $item, float $startTime, ?array &$metadata) {
6262
if ($item->expiry > $endTime = microtime(true)) {
6363
$item->newMetadata[CacheItem::METADATA_EXPIRY] = $metadata[CacheItem::METADATA_EXPIRY] = $item->expiry;
64-
$item->newMetadata[CacheItem::METADATA_CTIME] = $metadata[CacheItem::METADATA_CTIME] = 1000 * (int) ($endTime - $startTime);
64+
$item->newMetadata[CacheItem::METADATA_CTIME] = $metadata[CacheItem::METADATA_CTIME] = (int) ceil(1000 * ($endTime - $startTime));
6565
} else {
6666
unset($metadata[CacheItem::METADATA_EXPIRY], $metadata[CacheItem::METADATA_CTIME]);
6767
}

src/Symfony/Component/HttpClient/NativeHttpClient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ public function request(string $method, string $url, array $options = []): Respo
221221
];
222222

223223
$proxy = self::getProxy($options['proxy'], $url);
224-
$noProxy = $_SERVER['no_proxy'] ?? $_SERVER['NO_PROXY'] ?? '';
224+
$noProxy = $options['no_proxy'] ?? $_SERVER['no_proxy'] ?? $_SERVER['NO_PROXY'] ?? '';
225225
$noProxy = $noProxy ? preg_split('/[\s,]+/', $noProxy) : [];
226226

227227
$resolveRedirect = self::createRedirectResolver($options, $host, $proxy, $noProxy, $info, $onProgress);

0 commit comments

Comments
 (0)