Merge pull request 'Fix #43: Offene Redirects via REQUEST_URI fixen' (#51) from feature/issue-43-open-redirect-fix into main
Some checks failed
Lint / PHP Syntax Check (push) Successful in 33s
Lint / HTML Lint (htmlhint) (push) Has been cancelled
Lint / CSS Lint (stylelint) (push) Has been cancelled

Reviewed-on: #51
This commit is contained in:
2026-05-22 08:32:23 +02:00

View File

@@ -51,7 +51,7 @@ class HomeController extends Controller
$honeypot = $normalizeContactValue((string) ($_POST['website'] ?? '')); $honeypot = $normalizeContactValue((string) ($_POST['website'] ?? ''));
if ($honeypot !== '') { if ($honeypot !== '') {
header('Location: ' . $_SERVER['REQUEST_URI'] . '#form-result'); header('Location: /#form-result');
$_SESSION['form_success'] = true; $_SESSION['form_success'] = true;
exit; exit;
} else { } else {
@@ -102,7 +102,7 @@ class HomeController extends Controller
if ($mailSent) { if ($mailSent) {
$_SESSION['last_contact_submit'] = time(); $_SESSION['last_contact_submit'] = time();
header('Location: ' . $_SERVER['REQUEST_URI'] . '#form-result'); header('Location: /#form-result');
$_SESSION['form_success'] = true; $_SESSION['form_success'] = true;
exit; exit;
} else { } else {
@@ -111,7 +111,7 @@ class HomeController extends Controller
} }
} }
if (!empty($formErrors)) { if (!empty($formErrors)) {
header('Location: ' . $_SERVER['REQUEST_URI'] . '#form-result'); header('Location: /#form-result');
$_SESSION['form_errors'] = $formErrors; $_SESSION['form_errors'] = $formErrors;
$_SESSION['form_data'] = $formData; $_SESSION['form_data'] = $formData;
exit; exit;