diff --git a/install.php b/install.php
index e5edfef..55fcff0 100644
--- a/install.php
+++ b/install.php
@@ -66,7 +66,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$content .= "}\n";
if (file_put_contents($config_file, $content)) {
- header('Location: ' . $_SERVER['PHP_SELF'] . '?step=3');
+ header('Location: ' . htmlspecialchars($_SERVER['SCRIPT_NAME']) . '?step=3');
exit;
} else {
$error = "Failed to write configuration file to $config_file. Please check permissions.";
@@ -123,7 +123,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
if (empty($errors)) {
$success = "Successfully applied $applied migrations.";
- header('Location: ' . $_SERVER['PHP_SELF'] . '?step=4');
+ header('Location: ' . htmlspecialchars($_SERVER['SCRIPT_NAME']) . '?step=4');
exit;
} else {
$error = "Applied migrations, but some errors occurred: