From 30eacc07374c2cc48a94249ec022272f8c8efe32 Mon Sep 17 00:00:00 2001 From: Flatlogic Bot Date: Thu, 18 Dec 2025 09:10:55 +0000 Subject: [PATCH] Auto commit: 2025-12-18T09:10:55.601Z --- admin/links.php | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/admin/links.php b/admin/links.php index 3204b4b..bf27a83 100644 --- a/admin/links.php +++ b/admin/links.php @@ -7,12 +7,7 @@ if (!isset($_SESSION['user_id']) || $_SESSION['user_role'] !== 'admin') { } // Debug block for POST data - visible only to admin -if ($_SESSION['user_role'] === 'admin' && $_SERVER['REQUEST_METHOD'] === 'POST') { - echo '
';
-    echo 'DEBUG INFORMATION (admin/links.php - POST Data):
'; - echo 'POST Parameters: ' . htmlspecialchars(json_encode($_POST, JSON_PRETTY_PRINT)) . '
'; - echo '
'; -} + require_once __DIR__ . '/../db/config.php'; $pdo = db(); @@ -25,7 +20,7 @@ if (empty($_SESSION['csrf_token'])) { if ($_SERVER['REQUEST_METHOD'] === 'POST') { header('Content-Type: application/json'); - $response = ['success' => false, 'message' => 'Invalid request.']; + $response = ['success' => false, 'message' => 'Invalid request.', 'debug_post' => $_POST ?? [] ]; if (!isset($_POST['csrf_token']) || !hash_equals($_SESSION['csrf_token'], $_POST['csrf_token'])) { $response['message'] = 'CSRF token validation failed.'; @@ -407,6 +402,7 @@ document.addEventListener('DOMContentLoaded', function() { }) .then(response => response.json()) .then(data => { + console.log('DEBUG POST Data:', data.debug_post); if (data.success) { alert(data.message); window.location.reload(); // Simple reload for now, can be optimized later