Commit 16ac0088 authored by Arnolds's avatar Arnolds
Browse files

Updated secret-api.php to properly validate empty 'secret' field in POST requests.

parent 8f3839ef
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -32,7 +32,7 @@ $method = $_SERVER['REQUEST_METHOD'];

$data = json_decode(file_get_contents('php://input'), true);
if ($method === 'POST' && isset($data['secret'])) {
    if ($data['secret']) {
    if (empty($data['secret'])) {
        http_response_code(400);
        echo json_encode(['error' => '<p class="mb-0">Hmm... noslēpuma lauciņš ir tukšs. Bez tā šī ir tikai "Glabātuve", nevis "Noslēpumu glabātuve" 😅.</p>']);
        exit;