improved errorhandler output

when error occurs while handling errors output was not readable in web
context
This commit is contained in:
Carsten Brandt
2013-10-13 15:19:20 +02:00
parent ee89134ffe
commit 3a981e26da

View File

@@ -450,7 +450,11 @@ abstract class Application extends Module
$msg .= "\nPrevious exception:\n";
$msg .= (string)$exception;
if (YII_DEBUG) {
echo $msg;
if (PHP_SAPI === 'cli') {
echo $msg . "\n";
} else {
echo '<pre>' . htmlspecialchars($msg, ENT_QUOTES, $this->charset) . '</pre>';
}
}
$msg .= "\n\$_SERVER = " . var_export($_SERVER, true);
error_log($msg);