mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-02 21:41:19 +08:00
Fixes #17152: Fixed error page when using traceline option
This commit is contained in:
committed by
Alexander Makarov
parent
0cbd1c12bc
commit
a7276f6b72
@ -9,6 +9,12 @@
|
||||
/* @var $end int */
|
||||
/* @var $args array */
|
||||
/* @var $handler \yii\web\ErrorHandler */
|
||||
$html = <<<HTML
|
||||
IDE
|
||||
<svg class="icon icon--new-window" focusable="false" aria-hidden="true" width="16" height="16">
|
||||
<use href="#new-window"></use>
|
||||
</svg>
|
||||
HTML;
|
||||
?>
|
||||
<li class="<?= ($index === 1 || !$handler->isCoreFile($file)) ? 'application' : '' ?> call-stack-item"
|
||||
data-line="<?= (int) ($line - $begin) ?>">
|
||||
@ -16,6 +22,10 @@
|
||||
<div class="element">
|
||||
<span class="item-number"><?= (int) $index ?>.</span>
|
||||
<span class="text"><?= $file !== null ? 'in ' . $handler->htmlEncode($file) : '' ?></span>
|
||||
<?php if ($handler->traceLine !== '{html}'): ?>
|
||||
<span> – </span>
|
||||
<?= strtr($handler->traceLine, ['{file}' => $file, '{line}' => $line + 1, '{html}' => $html]) ?>
|
||||
<?php endif; ?>
|
||||
<span class="at">
|
||||
<?= $line !== null ? 'at line' : '' ?>
|
||||
<span class="line"><?= $line !== null ? $line + 1 : '' ?></span>
|
||||
@ -34,14 +44,12 @@
|
||||
<?php for ($i = $begin; $i <= $end; ++$i): ?><div class="hover-line"></div><?php endfor; ?>
|
||||
<div class="code">
|
||||
<?php for ($i = $begin; $i <= $end; ++$i): ?><span class="lines-item"><?= (int) ($i + 1) ?></span><?php endfor; ?>
|
||||
<pre>
|
||||
<?php
|
||||
<pre><?php
|
||||
// fill empty lines with a whitespace to avoid rendering problems in opera
|
||||
for ($i = $begin; $i <= $end; ++$i) {
|
||||
echo (trim($lines[$i]) === '') ? " \n" : strtr($handler->traceLine, ['{file}' => $file, '{line}' => $i + 1, '{html}' => $handler->htmlEncode($lines[$i])]);
|
||||
echo (trim($lines[$i]) === '') ? " \n" : $handler->htmlEncode($lines[$i]);
|
||||
}
|
||||
?>
|
||||
</pre>
|
||||
?></pre>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
Reference in New Issue
Block a user