mastodonapi.php aktualisiert
This commit is contained in:
parent
d706d76ca7
commit
52e5c878ba
1 changed files with 11 additions and 1 deletions
|
|
@ -274,7 +274,17 @@ MD;
|
||||||
header("HTTP/1.1 $statusCode");
|
header("HTTP/1.1 $statusCode");
|
||||||
header("Content-Type: text/html; charset=UTF-8");
|
header("Content-Type: text/html; charset=UTF-8");
|
||||||
}
|
}
|
||||||
$redirectUrl = rtrim(dirname($_SERVER['REQUEST_URI']), '/'); // geht eine Ebene hoch
|
|
||||||
|
// Basis-URL aus der aktuellen Anfrage bestimmen
|
||||||
|
$fullUrl = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http")
|
||||||
|
. "://{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}";
|
||||||
|
|
||||||
|
// Trigger-Pfad aus der Yellow-Konfiguration holen
|
||||||
|
$triggerPath = $this->yellow->system->get("mastodonapiTriggerPath");
|
||||||
|
|
||||||
|
// Ziel-URL: Alles vor dem Trigger-Pfad abschneiden
|
||||||
|
$redirectUrl = str_replace($triggerPath, "/", $fullUrl);
|
||||||
|
|
||||||
echo "<!DOCTYPE html><html><head>";
|
echo "<!DOCTYPE html><html><head>";
|
||||||
echo "<meta http-equiv='refresh' content='5;url={$redirectUrl}'>";
|
echo "<meta http-equiv='refresh' content='5;url={$redirectUrl}'>";
|
||||||
echo "<title>Mastodon/GoToSocial API</title></head><body>";
|
echo "<title>Mastodon/GoToSocial API</title></head><body>";
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue