Handle special characters in error messages when html_errors is Off

Fixes #1538
This commit is contained in:
Simon Welsh 2014-03-15 14:38:54 +13:00
parent 99d6498467
commit dbb6ba82f8

View File

@ -135,8 +135,13 @@ class DebugView extends Object {
public function writeError($httpRequest, $errno, $errstr, $errfile, $errline, $errcontext) {
$errorType = self::$error_types[$errno];
$httpRequestEnt = htmlentities($httpRequest, ENT_COMPAT, 'UTF-8');
if (ini_get('html_errors')) {
$errstr = strip_tags($errstr);
} else {
$errstr = Convert::raw2xml($errstr);
}
echo '<div class="info ' . $errorType['class'] . '">';
echo "<h1>[" . $errorType['title'] . '] ' . strip_tags($errstr) . "</h1>";
echo "<h1>[" . $errorType['title'] . '] ' . $errstr . "</h1>";
echo "<h3>$httpRequestEnt</h3>";
echo "<p>Line <strong>$errline</strong> in <strong>$errfile</strong></p>";
echo '</div>';