mirror of
https://github.com/hnhx/librex.git
synced 2025-01-24 09:57:46 -03:00
stackexchange support with anonymousoverflow
This commit is contained in:
parent
f3b9badfbc
commit
b7776f0c7c
1 changed files with 11 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue