From a49f5b72c6ad8f5a524e418ea34352655000928d Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Tue, 7 Jun 2016 19:53:35 +0200 Subject: [PATCH] Print error message again, when 3rdparty submodule is not initialized - old code used Response which attempted to use OC::$server which is not and cannot be intialised at this part of the code. --- lib/base.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/base.php b/lib/base.php index e77a07239c432..b24acf09f60e2 100644 --- a/lib/base.php +++ b/lib/base.php @@ -513,7 +513,9 @@ public static function init() { } catch (\RuntimeException $e) { if (!self::$CLI) { - OC_Response::setStatus(OC_Response::STATUS_SERVICE_UNAVAILABLE); + $claimedProtocol = strtoupper($_SERVER['SERVER_PROTOCOL']); + $protocol = in_array($claimedProtocol, ['HTTP/1.0', 'HTTP/1.1', 'HTTP/2']) ? $claimedProtocol : 'HTTP/1.1'; + header($protocol . ' ' . OC_Response::STATUS_SERVICE_UNAVAILABLE); } // we can't use the template error page here, because this needs the // DI container which isn't available yet