mastodonapi.php aktualisiert
This commit is contained in:
parent
ff79613156
commit
f1707f96c6
1 changed files with 11 additions and 2 deletions
|
|
@ -1,4 +1,7 @@
|
|||
<?php
|
||||
// MastodonAPI extension, https://codeberg.org/simonpipe/yellow-mastodonapi
|
||||
// Yellow CMS Plugin for Mastodon & GoToSocial
|
||||
|
||||
class YellowMastodonAPI {
|
||||
const VERSION = "0.6";
|
||||
public $yellow;
|
||||
|
|
@ -269,9 +272,15 @@ MD;
|
|||
private function sendResponse($message, $statusCode = 200) {
|
||||
if (!headers_sent()) {
|
||||
header("HTTP/1.1 $statusCode");
|
||||
header("Content-Type: text/html");
|
||||
header("Content-Type: text/html; charset=UTF-8");
|
||||
}
|
||||
echo "<h1>" . htmlspecialchars($message) . "</h1>";
|
||||
$redirectUrl = rtrim(dirname($_SERVER['REQUEST_URI']), '/'); // geht eine Ebene hoch
|
||||
echo "<!DOCTYPE html><html><head>";
|
||||
echo "<meta http-equiv='refresh' content='5;url={$redirectUrl}'>";
|
||||
echo "<title>Mastodon/GoToSocial API</title></head><body>";
|
||||
echo "<p>" . htmlspecialchars($message) . "</p>";
|
||||
echo "<p>Du wirst in 5 Sekunden weitergeleitet…</p>";
|
||||
echo "</body></html>";
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue