summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2016-04-20 13:50:43 +0200
committerLukas Reschke <lukas@owncloud.com>2016-04-20 13:50:43 +0200
commitafad27fafd996f0e2e7117d9f431f9eb63736569 (patch)
treea85110bba245019f46496d6ec066830a82ce0dbd /lib
parentae27583fe2380ff05c7efb3dbe0719e6f7495921 (diff)
parentc609abf07522c9e1c90811f01e232488492e45b3 (diff)
downloadnextcloud-server-afad27fafd996f0e2e7117d9f431f9eb63736569.tar.gz
nextcloud-server-afad27fafd996f0e2e7117d9f431f9eb63736569.zip
Merge pull request #24075 from owncloud/no-html-on-cli
In case of fatal php errors and other unhandled exceptions no html er…
Diffstat (limited to 'lib')
-rw-r--r--lib/base.php11
-rw-r--r--lib/private/log/errorhandler.php3
2 files changed, 6 insertions, 8 deletions
diff --git a/lib/base.php b/lib/base.php
index 26be1161ba3..8ea164a5007 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -545,14 +545,9 @@ class OC {
OC_Util::isSetLocaleWorking();
if (!defined('PHPUNIT_RUN')) {
- $logger = \OC::$server->getLogger();
- OC\Log\ErrorHandler::setLogger($logger);
- if (\OC::$server->getConfig()->getSystemValue('debug', false)) {
- OC\Log\ErrorHandler::register(true);
- set_exception_handler(array('OC_Template', 'printExceptionErrorPage'));
- } else {
- OC\Log\ErrorHandler::register();
- }
+ OC\Log\ErrorHandler::setLogger(\OC::$server->getLogger());
+ $debug = \OC::$server->getConfig()->getSystemValue('debug', false);
+ OC\Log\ErrorHandler::register($debug);
}
// register the stream wrappers
diff --git a/lib/private/log/errorhandler.php b/lib/private/log/errorhandler.php
index 27cde4aa242..8899bcfcb03 100644
--- a/lib/private/log/errorhandler.php
+++ b/lib/private/log/errorhandler.php
@@ -44,6 +44,9 @@ class ErrorHandler {
if ($debug) {
set_error_handler(array($handler, 'onAll'), E_ALL);
+ if (\OC::$CLI) {
+ set_exception_handler(array('OC_Template', 'printExceptionErrorPage'));
+ }
} else {
set_error_handler(array($handler, 'onError'));
}