weitere Bearibeitung
This commit is contained in:
@@ -6,6 +6,15 @@ final class Response
|
||||
{
|
||||
public static function redirect(string $url): never
|
||||
{
|
||||
if (str_starts_with($url, '/') && function_exists('url')) {
|
||||
$url = \url($url);
|
||||
} else {
|
||||
$prefix = $_SERVER['KAFFEEKASSE_PROXY_PREFIX'] ?? '';
|
||||
if ($prefix !== '' && str_starts_with($url, '/') && !str_starts_with($url, $prefix)) {
|
||||
$url = $prefix . $url;
|
||||
}
|
||||
}
|
||||
|
||||
header('Location: ' . $url);
|
||||
exit;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user