Remove CSRF check
This commit is contained in:
@@ -126,15 +126,8 @@ if (isset($_POST['add_database'])) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
<?php
|
|
||||||
if (isset($_POST['restore'])) {
|
if (isset($_POST['restore'])) {
|
||||||
|
|
||||||
// ---------- Optional CSRF check (requires a hidden "csrf" in your restore form) ----------
|
|
||||||
if (!hash_equals($_SESSION['csrf'] ?? '', $_POST['csrf'] ?? '')) {
|
|
||||||
http_response_code(403);
|
|
||||||
exit("Invalid CSRF token.");
|
|
||||||
}
|
|
||||||
|
|
||||||
// ---------- Inline helpers (guarded) ----------
|
// ---------- Inline helpers (guarded) ----------
|
||||||
if (!function_exists('recursiveCopy')) {
|
if (!function_exists('recursiveCopy')) {
|
||||||
function recursiveCopy(string $src, string $dst): void {
|
function recursiveCopy(string $src, string $dst): void {
|
||||||
|
|||||||
Reference in New Issue
Block a user