diff --git a/mastodonapi.php b/mastodonapi.php index 9736134..4fa0823 100644 --- a/mastodonapi.php +++ b/mastodonapi.php @@ -274,7 +274,17 @@ MD; header("HTTP/1.1 $statusCode"); 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 ""; echo ""; echo "Mastodon/GoToSocial API";