mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Handle special characters in error messages when html_errors is Off
Fixes #1538
This commit is contained in:
parent
99d6498467
commit
dbb6ba82f8
@ -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>';
|
||||
|
Loading…
Reference in New Issue
Block a user