File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
src/Symfony/Component/HttpKernel/Profiler Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -144,11 +144,19 @@ public function write(Profile $profile)
144
144
}
145
145
}
146
146
147
+ $ profileToken = $ profile ->getToken ();
148
+ // when there are errors in sub-requests, the parent and/or children tokens
149
+ // may equal the profile token, resulting in infinite loops
150
+ $ parentToken = $ profile ->getParentToken () !== $ profileToken ? $ profile ->getParentToken () : null ;
151
+ $ childrenToken = array_filter (array_map (function ($ p ) use ($ profileToken ) {
152
+ return $ profileToken !== $ p ->getToken () ? $ p ->getToken () : null ;
153
+ }, $ profile ->getChildren ()));
154
+
147
155
// Store profile
148
156
$ data = array (
149
- 'token ' => $ profile -> getToken () ,
150
- 'parent ' => $ profile -> getParentToken () ,
151
- 'children ' => array_map ( function ( $ p ) { return $ p -> getToken (); }, $ profile -> getChildren ()) ,
157
+ 'token ' => $ profileToken ,
158
+ 'parent ' => $ parentToken ,
159
+ 'children ' => $ childrenToken ,
152
160
'data ' => $ profile ->getCollectors (),
153
161
'ip ' => $ profile ->getIp (),
154
162
'method ' => $ profile ->getMethod (),
You can’t perform that action at this time.
0 commit comments