Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed error handler not escaping error info in debug mode #14492

Merged
merged 5 commits into from
Jul 21, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion framework/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ Yii Framework 2 Change Log
- Bug #14423: Fixed `ArrayHelper::merge` behavior with null values for integer-keyed elements (dmirogin)
- Bug #14406: Fixed caching rules in `yii\web\UrlManager` with different ruleConfig configuration (dmirogin)
- Chg #7936: Deprecate `yii\base\Object` in favor of `yii\base\BaseObject` for compatibility with PHP 7.2 (rob006, cebe, klimov-paul)
- Bug #14492: Fixed error handler not escaping error info debug mode (samdark)
- Chg #14487: Changed i18n message error to warning (dmirogin)


2.0.12 June 05, 2017
--------------------

Expand Down
2 changes: 1 addition & 1 deletion framework/views/errorHandler/exception.php
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@
<h2><?= nl2br($handler->htmlEncode($exception->getMessage())) ?></h2>

<?php if ($exception instanceof \yii\db\Exception && !empty($exception->errorInfo)): ?>
<pre>Error Info: <?php print_r($exception->errorInfo, true) ?></pre>
<pre>Error Info: <?= $handler->htmlEncode(print_r($exception->errorInfo, true)) ?></pre>
<?php endif ?>

<?= $handler->renderPreviousExceptions($exception) ?>
Expand Down
2 changes: 1 addition & 1 deletion framework/views/errorHandler/previousException.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<h3><?= nl2br($handler->htmlEncode($exception->getMessage())) ?></h3>
<p>in <span class="file"><?= $exception->getFile() ?></span> at line <span class="line"><?= $exception->getLine() ?></span></p>
<?php if ($exception instanceof \yii\db\Exception && !empty($exception->errorInfo)): ?>
<pre>Error Info: <?php print_r($exception->errorInfo, true) ?></pre>
<pre>Error Info: <?= $handler->htmlEncode(print_r($exception->errorInfo, true)) ?></pre>
<?php endif ?>
<?= $handler->renderPreviousExceptions($exception) ?>
</div>