From 3c11223d6a86232fccff78f0e225f05e6d62b8fc Mon Sep 17 00:00:00 2001 From: ManeraKai Date: Fri, 3 Feb 2023 10:30:19 +0300 Subject: [PATCH] Fixed wikia not redirecting properly https://github.com/libredirect/libredirect/issues/611#issuecomment-1414939502 --- src/assets/javascripts/services.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/assets/javascripts/services.js b/src/assets/javascripts/services.js index 7a9f3d9..f409715 100644 --- a/src/assets/javascripts/services.js +++ b/src/assets/javascripts/services.js @@ -345,10 +345,9 @@ function redirect(url, type, initiator, forceRedirection) { } return randomInstance case "breezeWiki": - let wiki, - urlpath = "" - if (url.hostname.match(/^[a-zA-Z0-9-]+\.fandom\.com/)) { - wiki = url.hostname.match(/^[a-zA-Z0-9-]+(?=\.fandom\.com)/) + let wiki, urlpath = "" + if (url.hostname.match(/^[a-zA-Z0-9-]+\.(?:fandom|wikia)\.com/)) { + wiki = url.hostname.match(/^[a-zA-Z0-9-]+(?=\.(?:fandom|wikia)\.com)/) if (wiki == "www" || !wiki) wiki = "" else wiki = `/${wiki}`; urlpath = url.pathname