Skip to content

Commit

Permalink
Fix #528: Fix yii\debug\Panel::getTraceLine() to handle backtrace f…
Browse files Browse the repository at this point in the history
…or internal PHP functions
  • Loading branch information
zymeli authored Dec 4, 2023
1 parent f17371b commit 0838a2b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Yii Framework 2 debug extension Change Log
2.1.26 under development
------------------------

- no changes in this release.
- Bug #528: Fix `yii\debug\Panel::getTraceLine()` to handle backtrace for internal PHP functions (zymeli)


2.1.25 September 26, 2023
Expand Down
8 changes: 8 additions & 0 deletions src/Panel.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,14 @@ public function getUrl($additionalParams = null)
*/
public function getTraceLine($options)
{
/**
* If an internal PHP function, such as `call_user_func`, in the backtrace, the 'file' and 'line' not be available.
* @see https://www.php.net/manual/en/function.debug-backtrace.php#59713
*/
if (!isset($options['file'])) {
return VarDumper::dumpAsString($options);
}

if (!isset($options['text'])) {
$options['text'] = "{$options['file']}:{$options['line']}";
}
Expand Down
2 changes: 1 addition & 1 deletion src/views/default/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<div id="yii-debug-toolbar" class="yii-debug-toolbar yii-debug-toolbar_position_top" style="display: none;">
<div class="yii-debug-toolbar__bar">
<div class="yii-debug-toolbar__block yii-debug-toolbar__title">
<a href="#">
<a href="<?= Url::to(['index']) ?>">
<img width="30" height="30" alt="" src="<?= \yii\debug\Module::getYiiLogo() ?>">
</a>
</div>
Expand Down

0 comments on commit 0838a2b

Please sign in to comment.