diff options
author | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2024-05-24 11:03:22 +0200 |
---|---|---|
committer | nextcloud-command <nextcloud-command@users.noreply.github.com> | 2024-06-04 13:26:56 +0000 |
commit | a2f7b59d340db29d17f97452eb4dc5be28688535 (patch) | |
tree | 78117d848c874f9b42614712e1cb989124c59bc8 /core/src | |
parent | 849587ae2b47393ac3797eb0c242f6cf9533ff4a (diff) | |
download | nextcloud-server-a2f7b59d340db29d17f97452eb4dc5be28688535.tar.gz nextcloud-server-a2f7b59d340db29d17f97452eb4dc5be28688535.zip |
fix(core): unsupported browser redirect url
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'core/src')
-rw-r--r-- | core/src/views/UnsupportedBrowser.vue | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/core/src/views/UnsupportedBrowser.vue b/core/src/views/UnsupportedBrowser.vue index f9125fa9958..94b0e0a25ec 100644 --- a/core/src/views/UnsupportedBrowser.vue +++ b/core/src/views/UnsupportedBrowser.vue @@ -140,12 +140,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('/') }, |