From 0de90cfc672ebb8bb7c8ffa01d40380715c42f94 Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Wed, 26 Jul 2017 16:30:09 +0200 Subject: Fix 403 and 404 redirect * Nextcloud is not properly loaded in the standalone version (especially the theming) * it is already not listed anymore in the Nginx config (see nextcloud/documentation#392) * the index.php-free version doesn't support this Signed-off-by: Morris Jobke --- core/templates/403.php | 8 ++++---- core/templates/404.php | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'core') diff --git a/core/templates/403.php b/core/templates/403.php index 7d07c72c873..e053fad764a 100644 --- a/core/templates/403.php +++ b/core/templates/403.php @@ -1,10 +1,10 @@ printPage(); + + $urlGenerator = \OC::$server->getURLGenerator(); + header('Location: ' . $urlGenerator->getAbsoluteURL('/')); exit; } // @codeCoverageIgnoreEnd diff --git a/core/templates/404.php b/core/templates/404.php index cc45cbeaf5d..0f7318e937a 100644 --- a/core/templates/404.php +++ b/core/templates/404.php @@ -3,11 +3,11 @@ /** @var $l \OCP\IL10N */ /** @var $theme OCP\Defaults */ // @codeCoverageIgnoreStart -if(!isset($_)) {//also provide standalone error page +if(!isset($_)) {//standalone page is not supported anymore - redirect to / require_once '../../lib/base.php'; - - $tmpl = new OC_Template( '', '404', 'guest' ); - $tmpl->printPage(); + + $urlGenerator = \OC::$server->getURLGenerator(); + header('Location: ' . $urlGenerator->getAbsoluteURL('/')); exit; } // @codeCoverageIgnoreEnd -- cgit v1.2.3