Validate chatroom report content

This commit is contained in:
2025-09-09 22:49:06 -07:00
parent b3463ef5ec
commit 14f046f71a

View File

@@ -9,6 +9,10 @@ $reason = $post['reason'] ?? '';
$token = $post['token'] ?? '';
$username = $post['username'] ?? '';
if (!preg_match('/^[ a-zA-Z0-9!@#\$%\^&\*\(\)_\+\-=\[\]\{\};\':",\.<>\/\?\\\\|`~]+$/', $reason)) {
exitWithMessage(json_encode(["success" => false]));
}
$conn = newConnection();
$stmt = $conn->prepare("SELECT * FROM users WHERE token = ? AND username = ?");