aboutsummaryrefslogtreecommitdiffstats
path: root/core/src
diff options
context:
space:
mode:
authorJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2024-05-24 11:03:22 +0200
committerskjnldsv <skjnldsv@protonmail.com>2024-06-01 09:34:22 +0200
commitfc3ee6552627613b87306ba7aa95d30d51b88695 (patch)
tree79d84c582fbe187dc939b2676aaad322dacabc7e /core/src
parent2a5d3fd92a36315ef910d1217123b6a860c689e5 (diff)
downloadnextcloud-server-fc3ee6552627613b87306ba7aa95d30d51b88695.tar.gz
nextcloud-server-fc3ee6552627613b87306ba7aa95d30d51b88695.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.vue12
1 files changed, 11 insertions, 1 deletions
diff --git a/core/src/views/UnsupportedBrowser.vue b/core/src/views/UnsupportedBrowser.vue
index 6754503f69f..c0331cb1f9b 100644
--- a/core/src/views/UnsupportedBrowser.vue
+++ b/core/src/views/UnsupportedBrowser.vue
@@ -112,12 +112,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('/')
},