From b7776f0c7c6ea787cff30dbc337136534af9182b Mon Sep 17 00:00:00 2001 From: Revvy Date: Sun, 28 May 2023 17:47:35 -0400 Subject: [PATCH] stackexchange support with anonymousoverflow --- misc/tools.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/misc/tools.php b/misc/tools.php index 19f36cb..6735220 100644 --- a/misc/tools.php +++ b/misc/tools.php @@ -56,6 +56,12 @@ $gist_path = explode("gist.github.com", $url)[1]; $url = $frontend . "/gist" . $gist_path; } + else if (strpos($url, "stackexchange.com") !== false) + { + $se_domain = explode(".", explode("://", $url)[1])[0]; + $se_path = explode("stackexchange.com", $url)[1]; + $url = $frontend . "/exchange" . "/" . $se_domain . $se_path; + } else { $url = $frontend . explode($original, $url)[1]; @@ -85,6 +91,11 @@ $url = try_replace_with_frontend($url, $frontend, $original); break; } + else if (strpos($url, "stackexchange.com")) + { + $url = try_replace_with_frontend($url, "anonymousoverflow", "stackexchange.com"); + break; + } } return $url;