aboutsummaryrefslogtreecommitdiffstats
path: root/index.php
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2018-06-26 09:17:37 +0200
committerMorris Jobke <hey@morrisjobke.de>2018-06-26 11:44:24 +0200
commit8c155cd51cb55c89f16d9bcfcb397d4e784ac108 (patch)
tree52aa69f7db242bb0382e374490526af13a2af9d2 /index.php
parenta97cc293b5f04ee1d25a5e41103586f16ff02927 (diff)
downloadnextcloud-server-8c155cd51cb55c89f16d9bcfcb397d4e784ac108.tar.gz
nextcloud-server-8c155cd51cb55c89f16d9bcfcb397d4e784ac108.zip
Server error/hint pages with a 500 error code to avoid it being seen instead of the actual resource
* found while reviewing #7205 * allow to specify a special status code Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'index.php')
-rw-r--r--index.php6
1 files changed, 2 insertions, 4 deletions
diff --git a/index.php b/index.php
index 1ce80b17880..75511de12e1 100644
--- a/index.php
+++ b/index.php
@@ -48,9 +48,8 @@ try {
OC_Response::setStatus(OC_Response::STATUS_SERVICE_UNAVAILABLE);
OC_Template::printExceptionErrorPage($ex);
} catch (\OC\HintException $ex) {
- OC_Response::setStatus(OC_Response::STATUS_SERVICE_UNAVAILABLE);
try {
- OC_Template::printErrorPage($ex->getMessage(), $ex->getHint());
+ OC_Template::printErrorPage($ex->getMessage(), $ex->getHint(), OC_Response::STATUS_SERVICE_UNAVAILABLE);
} catch (Exception $ex2) {
\OC::$server->getLogger()->logException($ex, array('app' => 'index'));
\OC::$server->getLogger()->logException($ex2, array('app' => 'index'));
@@ -60,8 +59,7 @@ try {
OC_Template::printExceptionErrorPage($ex);
}
} catch (\OC\User\LoginException $ex) {
- OC_Response::setStatus(OC_Response::STATUS_FORBIDDEN);
- OC_Template::printErrorPage($ex->getMessage(), $ex->getMessage());
+ OC_Template::printErrorPage($ex->getMessage(), $ex->getMessage(), OC_Response::STATUS_FORBIDDEN);
} catch (Exception $ex) {
\OC::$server->getLogger()->logException($ex, array('app' => 'index'));