From fbb585ffb2faaa2f161bc7987e73282d5b3a2d96 Mon Sep 17 00:00:00 2001 From: Guilherme Blanco Date: Fri, 16 Mar 2012 14:42:43 -0300 Subject: [PATCH] Update src/Symfony/Component/HttpKernel/Profiler/PdoProfilerStorage.php --- .../Component/HttpKernel/Profiler/PdoProfilerStorage.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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; }