Skip to content
Snippets Groups Projects
Verified Commit 20ab0417 authored by Laurent Heirendt's avatar Laurent Heirendt :airplane:
Browse files

catch for external cards accessed internally

parent 5270d409
No related branches found
No related tags found
No related merge requests found
Pipeline #15756 passed
......@@ -27,8 +27,18 @@
if(status === 200){
// internal pages
if (sub.length > 0) { sub = 'internal/'+sub; }
window.location.href = 'https://r3-core.pages.uni.lu/howto-cards-internal/stable/'+sub;
if (sub.length > 0) {
UrlExists('https://r3-core.pages.uni.lu/howto-cards-internal/stable/internal/'+sub, function(status){
// redirect if card is actually internal and exists
if (status == 200) {
window.location.href = 'https://r3-core.pages.uni.lu/howto-cards-internal/stable/internal/'+sub;
} else {
window.location.href = 'https://r3-core.pages.uni.lu/howto-cards-internal/stable/external/'+sub;
}
} else {
window.location.href = 'https://r3-core.pages.uni.lu/howto-cards-internal/stable/'+sub;
}
} else {
// external pages
if (sub.length > 0) { sub = 'external/'+sub; }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment