From 3a981e26dabb389ddb9e2cb23168a5e091fc3c0c Mon Sep 17 00:00:00 2001 From: Carsten Brandt Date: Sun, 13 Oct 2013 15:19:20 +0200 Subject: [PATCH] improved errorhandler output when error occurs while handling errors output was not readable in web context --- framework/yii/base/Application.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/framework/yii/base/Application.php b/framework/yii/base/Application.php index 3cc90d9..683b9ce 100644 --- a/framework/yii/base/Application.php +++ b/framework/yii/base/Application.php @@ -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 '
' . htmlspecialchars($msg, ENT_QUOTES, $this->charset) . '
'; + } } $msg .= "\n\$_SERVER = " . var_export($_SERVER, true); error_log($msg);