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