diff options
author | John Molakvoæ <skjnldsv@users.noreply.github.com> | 2024-06-04 15:48:33 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-04 15:48:33 +0200 |
commit | 3663c4a719be285669d7c1198e20646cf6581dd4 (patch) | |
tree | c4132f38b6fc996ee319816f124eee29d21afab1 /core | |
parent | 849587ae2b47393ac3797eb0c242f6cf9533ff4a (diff) | |
parent | 737084ea3e42103d27359240444278bdd7b94903 (diff) | |
download | nextcloud-server-3663c4a719be285669d7c1198e20646cf6581dd4.tar.gz nextcloud-server-3663c4a719be285669d7c1198e20646cf6581dd4.zip |
Merge pull request #45624 from nextcloud/backport/45494/stable27
Diffstat (limited to 'core')
-rw-r--r-- | core/Controller/UnsupportedBrowserController.php | 4 | ||||
-rw-r--r-- | core/src/views/UnsupportedBrowser.vue | 15 |
2 files changed, 16 insertions, 3 deletions
diff --git a/core/Controller/UnsupportedBrowserController.php b/core/Controller/UnsupportedBrowserController.php index 8cdc190deea..4baa936a962 100644 --- a/core/Controller/UnsupportedBrowserController.php +++ b/core/Controller/UnsupportedBrowserController.php @@ -46,6 +46,8 @@ class UnsupportedBrowserController extends Controller { public function index(): Response { Util::addScript('core', 'unsupported-browser'); Util::addStyle('core', 'icons'); - return new TemplateResponse('core', 'unsupportedbrowser', [], TemplateResponse::RENDER_AS_ERROR); + + // not using RENDER_AS_ERROR as we need the JSConfigHelper for url generation + return new TemplateResponse('core', 'unsupportedbrowser', [], TemplateResponse::RENDER_AS_GUEST); } } diff --git a/core/src/views/UnsupportedBrowser.vue b/core/src/views/UnsupportedBrowser.vue index f9125fa9958..02045856473 100644 --- a/core/src/views/UnsupportedBrowser.vue +++ b/core/src/views/UnsupportedBrowser.vue @@ -48,8 +48,9 @@ </template> <script> -import { generateUrl } from '@nextcloud/router' +import { generateUrl, getRootUrl } from '@nextcloud/router' import { translate as t, translatePlural as n } from '@nextcloud/l10n' + import NcButton from '@nextcloud/vue/dist/Components/NcButton.js' import NcEmptyContent from '@nextcloud/vue/dist/Components/NcEmptyContent.js' import Web from 'vue-material-design-icons/Web.vue' @@ -140,12 +141,22 @@ export default { // Redirect if there is the data const urlParams = new URLSearchParams(window.location.search) if (urlParams.has('redirect_url')) { - const redirectPath = Buffer.from(urlParams.get('redirect_url'), 'base64').toString() || '/' + let redirectPath = Buffer.from(urlParams.get('redirect_url'), 'base64').toString() || '/' + + // remove index.php and double slashes + redirectPath = redirectPath + .replace('index.php', '') + .replace(getRootUrl(), '') + .replace(/\/\//g, '/') + + // if we have a valid redirect url, use it if (redirectPath.startsWith('/')) { window.location = generateUrl(redirectPath) return } } + + // else redirect to root window.location = generateUrl('/') }, |