diff --git a/src/Symfony/Component/HttpKernel/Profiler/PdoProfilerStorage.php b/src/Symfony/Component/HttpKernel/Profiler/PdoProfilerStorage.php index 118abba3ce89..1c90eaeb2ab6 100644 --- a/src/Symfony/Component/HttpKernel/Profiler/PdoProfilerStorage.php +++ b/src/Symfony/Component/HttpKernel/Profiler/PdoProfilerStorage.php @@ -201,7 +201,8 @@ protected function createProfileFromData($token, $data, $parent = null) $profile->setTime($data['time']); $profile->setCollectors(unserialize(base64_decode($data['data']))); - if (!$parent && isset($data['parent']) && $data['parent']) { + // Under sub-requests, $data['parent'] === $token in an exception situation + if (!$parent && isset($data['parent']) && $data['parent'] && $data['parent'] !== $token) { $parent = $this->read($data['parent']); } @@ -209,7 +210,10 @@ protected function createProfileFromData($token, $data, $parent = null) $profile->setParent($parent); } - $profile->setChildren($this->readChildren($token, $profile)); + // Avoid inspecting children under sub-request exception + if (!$parent || $parent->getToken() !== $token) { + $profile->setChildren($this->readChildren($token, $profile)); + } return $profile; }