Skip to content

Commit 85d0165

Browse files
bug #54045 [Config][Messenger][Security] Don't turn deprecations into exceptions when unserializing (nicolas-grekas)
This PR was merged into the 5.4 branch. Discussion ---------- [Config][Messenger][Security] Don't turn deprecations into exceptions when unserializing | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | - | License | MIT A deprecation ain't mean b0rken. Commits ------- 6518910 [Config][Messenger][Security] Don't turn deprecations into exceptions when unserializing
2 parents 1a4748e + 6518910 commit 85d0165

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/Symfony/Component/Config/ResourceCheckerConfigCache.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ private function safelyUnserialize(string $file)
156156
$signalingException = new \UnexpectedValueException();
157157
$prevUnserializeHandler = ini_set('unserialize_callback_func', self::class.'::handleUnserializeCallback');
158158
$prevErrorHandler = set_error_handler(function ($type, $msg, $file, $line, $context = []) use (&$prevErrorHandler, $signalingException) {
159-
if (__FILE__ === $file) {
159+
if (__FILE__ === $file && !\in_array($type, [\E_DEPRECATED, \E_USER_DEPRECATED], true)) {
160160
throw $signalingException;
161161
}
162162

src/Symfony/Component/Messenger/Transport/Serialization/PhpSerializer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ private function safelyUnserialize(string $contents)
5858

5959
$prevUnserializeHandler = ini_set('unserialize_callback_func', self::class.'::handleUnserializeCallback');
6060
$prevErrorHandler = set_error_handler(function ($type, $msg, $file, $line, $context = []) use (&$prevErrorHandler) {
61-
if (__FILE__ === $file) {
61+
if (__FILE__ === $file && !\in_array($type, [\E_DEPRECATED, \E_USER_DEPRECATED], true)) {
6262
throw new \ErrorException($msg, 0, $type, $file, $line);
6363
}
6464

src/Symfony/Component/Security/Http/Firewall/ContextListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ private function safelyUnserialize(string $serializedToken)
301301
$token = null;
302302
$prevUnserializeHandler = ini_set('unserialize_callback_func', __CLASS__.'::handleUnserializeCallback');
303303
$prevErrorHandler = set_error_handler(function ($type, $msg, $file, $line, $context = []) use (&$prevErrorHandler) {
304-
if (__FILE__ === $file) {
304+
if (__FILE__ === $file && !\in_array($type, [\E_DEPRECATED, \E_USER_DEPRECATED], true)) {
305305
throw new \ErrorException($msg, 0x37313BC, $type, $file, $line);
306306
}
307307

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy