From 986623e2acdb199fb5f929bb2242842726b50bf1 Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Mon, 22 Jan 2018 15:58:57 +0100 Subject: [PATCH] Send a proper response for status.php on trusted domain error * fixes #7732 Signed-off-by: Morris Jobke --- lib/base.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/base.php b/lib/base.php index d0672785ce..080b268795 100644 --- a/lib/base.php +++ b/lib/base.php @@ -779,8 +779,16 @@ class OC { $isScssRequest = true; } + if(substr($request->getRequestUri(), -11) === '/status.php') { + OC_Response::setStatus(\OC_Response::STATUS_BAD_REQUEST); + header('Status: 400 Bad Request'); + header('Content-Type: application/json'); + echo '{"error": "Trusted domain error.", "code": 15}'; + exit(); + } + if (!$isScssRequest) { - header('HTTP/1.1 400 Bad Request'); + OC_Response::setStatus(\OC_Response::STATUS_BAD_REQUEST); header('Status: 400 Bad Request'); \OC::$server->getLogger()->warning(