mirror of
https://gitlab.com/ruany/litebans-php.git
synced 2025-05-23 08:29:06 +00:00
Validate before connecting.
This commit is contained in:
parent
0848871c67
commit
331207f069
@ -1,12 +1,12 @@
|
||||
<?php
|
||||
if (isset($_POST['name'], $_POST['table'])) {
|
||||
require 'includes/page.php';
|
||||
$name = $_POST['name'];
|
||||
// validate user input
|
||||
if (strlen($name) > 16 || !preg_match("/[0-9a-zA-Z_]/", $name)) {
|
||||
echo('Invalid name.');
|
||||
return;
|
||||
}
|
||||
require 'includes/page.php';
|
||||
|
||||
global $table_bans, $table_history, $conn;
|
||||
$stmt = $conn->prepare("SELECT name,uuid FROM " . $table_history . " WHERE name=? ORDER BY date LIMIT 1");
|
||||
|
Loading…
x
Reference in New Issue
Block a user