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 9d3180a

Browse filesBrowse files
[Config] ensure moving away from Serializable wont break cache:clear
1 parent 3cfb558 commit 9d3180a
Copy full SHA for 9d3180a

File tree

Expand file treeCollapse file tree

1 file changed

+3
-2
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-2
lines changed

‎src/Symfony/Component/Config/ResourceCheckerConfigCache.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Config/ResourceCheckerConfigCache.php
+3-2Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,18 +156,19 @@ private function safelyUnserialize($file)
156156
{
157157
$e = null;
158158
$meta = false;
159+
$content = file_get_contents($file);
159160
$signalingException = new \UnexpectedValueException();
160161
$prevUnserializeHandler = ini_set('unserialize_callback_func', '');
161162
$prevErrorHandler = set_error_handler(function ($type, $msg, $file, $line, $context = []) use (&$prevErrorHandler, $signalingException) {
162-
if (E_WARNING === $type && 'Class __PHP_Incomplete_Class has no unserializer' === $msg) {
163+
if (__FILE__ === $file) {
163164
throw $signalingException;
164165
}
165166

166167
return $prevErrorHandler ? $prevErrorHandler($type, $msg, $file, $line, $context) : false;
167168
});
168169

169170
try {
170-
$meta = unserialize(file_get_contents($file));
171+
$meta = unserialize($content);
171172
} catch (\Error $e) {
172173
} catch (\Exception $e) {
173174
}

0 commit comments

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