10000 fixed: fixed the bug of request_panel.php in WebProfiler · lcf/symfony@ade5fd6 · GitHub
[go: up one dir, main page]

Skip to content

Commit ade5fd6

Browse files
brtriverfabpot
authored andcommitted
fixed: fixed the bug of request_panel.php in WebProfiler
When the session attributes don't exist, $data->sessionAttributes->getRawValue() cannot be called as not being defined. So check the session attributes before calling getRawValue()
1 parent 5c406b9 commit ade5fd6

File tree

1 file changed

+18
-16
lines changed

1 file changed

+18
-16
lines changed

src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/request_panel.php

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -42,20 +42,22 @@
4242
<th>Value</th>
4343
</tr>
4444

45-
<?php foreach ($data->getSessionAttributes()->getRawValue() as $key => $value): ?>
46-
<tr>
47-
<th><?php echo $key ?></th>
48-
<td>
49-
<?php if (is_object($value)): ?>
50-
<em>Object</em>
51-
<?php elseif (is_resource($value)): ?>
52-
<em>Resource</em>
53-
<?php elseif (is_array($value)): ?>
54-
<em>Array</em>
55-
<?php else: ?>
56-
<?php echo $value ?>
57-
<?php endif; ?>
58-
</td>
59-
</tr>
60-
<?php endforeach; ?>
45+
<?php if (count($sessionAttributes = $data->getSessionAttributes())):?>
46+
<?php foreach ($sessionAttributes->getRawValue() as $key => $value): ?>
47+
<tr>
48+
<th><?php echo $key ?></th>
49+
<td>
50+
<?php if (is_object($value)): ?>
51+
<em>Object</em>
52+
<?php elseif (is_resource($value)): ?>
53+
<em>Resource</em>
54+
<?php elseif (is_array($value)): ?>
55+
<em>Array</em>
56+
<?php else: ?>
57+
<?php echo $value ?>
58+
<?php endif; ?>
59+
</td>
60+
</tr>
61+
<?php endforeach; ?>
62+
<?php endif; ?>
6163
</table>

0 commit comments

Comments
 (0)
0