diff options
author | Morris Jobke <hey@morrisjobke.de> | 2015-03-02 09:19:26 +0100 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2015-03-02 09:19:26 +0100 |
commit | 4009f152558fd5a18cddb37be776fe38e79879c9 (patch) | |
tree | a37e211a701746b1154583040816e1d94c3cd846 /lib | |
parent | 7194952db487b22b2b15ae4c76d3fbbc93908c04 (diff) | |
parent | afb0d742b9137b2ab0db7a3c90f8baafbfb26ca6 (diff) | |
download | nextcloud-server-4009f152558fd5a18cddb37be776fe38e79879c9.tar.gz nextcloud-server-4009f152558fd5a18cddb37be776fe38e79879c9.zip |
Merge pull request #14593 from owncloud/fix/13994
Add detection for invalid CLI configuration for settings page
Diffstat (limited to 'lib')
-rw-r--r-- | lib/base.php | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/lib/base.php b/lib/base.php index a97b1b3dade..1f2e90deefd 100644 --- a/lib/base.php +++ b/lib/base.php @@ -575,15 +575,30 @@ class OC { $errors = OC_Util::checkServer(\OC::$server->getConfig()); if (count($errors) > 0) { if (self::$CLI) { + // Convert l10n string into regular string for usage in database + $staticErrors = []; foreach ($errors as $error) { echo $error['error'] . "\n"; echo $error['hint'] . "\n\n"; + $staticErrors[] = [ + 'error' => (string) $error['error'], + 'hint' => (string) $error['hint'], + ]; } + + try { + \OC::$server->getConfig()->setAppValue('core', 'cronErrors', json_encode($staticErrors)); + } catch(\Exception $e) { + echo('Writing to database failed'); + } + exit(); } else { OC_Response::setStatus(OC_Response::STATUS_SERVICE_UNAVAILABLE); OC_Template::printGuestPage('', 'error', array('errors' => $errors)); + exit; } - exit; + } elseif(self::$CLI && \OC::$server->getConfig()->getSystemValue('installed', false)) { + \OC::$server->getConfig()->deleteAppValue('core', 'cronErrors'); } //try to set the session lifetime |