Verified Commit 20ab0417 authored by Laurent Heirendt's avatar Laurent Heirendt
Browse files

catch for external cards accessed internally

parent 5270d409
Pipeline #15756 passed with stage
in 1 minute and 28 seconds
...@@ -27,8 +27,18 @@ ...@@ -27,8 +27,18 @@
if(status === 200){ if(status === 200){
// internal pages // internal pages
if (sub.length > 0) { sub = 'internal/'+sub; } if (sub.length > 0) {
window.location.href = 'https://r3-core.pages.uni.lu/howto-cards-internal/stable/'+sub; 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 { } else {
// external pages // external pages
if (sub.length > 0) { sub = 'external/'+sub; } if (sub.length > 0) { sub = 'external/'+sub; }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment