Skip to content

Commit a49f5b7

Browse files
committed
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.
1 parent fb49819 commit a49f5b7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/base.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,9 @@ public static function init() {
513513

514514
} catch (\RuntimeException $e) {
515515
if (!self::$CLI) {
516-
OC_Response::setStatus(OC_Response::STATUS_SERVICE_UNAVAILABLE);
516+
$claimedProtocol = strtoupper($_SERVER['SERVER_PROTOCOL']);
517+
$protocol = in_array($claimedProtocol, ['HTTP/1.0', 'HTTP/1.1', 'HTTP/2']) ? $claimedProtocol : 'HTTP/1.1';
518+
header($protocol . ' ' . OC_Response::STATUS_SERVICE_UNAVAILABLE);
517519
}
518520
// we can't use the template error page here, because this needs the
519521
// DI container which isn't available yet

0 commit comments

Comments
 (0)