bugifxes
This commit is contained in:
parent
e02816e81e
commit
0a7e99becd
1 changed files with 10 additions and 0 deletions
|
@ -10,9 +10,19 @@
|
|||
global $db;
|
||||
if (!$username) return;
|
||||
if (!array_key_exists('post',$_POST)) return;
|
||||
|
||||
|
||||
$postie = $_POST['post'];
|
||||
|
||||
if (strlen($postie) < 1 || strlen($postie) > 1024) {
|
||||
return 'Post is too long or short.';
|
||||
}
|
||||
|
||||
$stmt = $db->prepare("INSERT INTO main.comment (username, targetType, targetId, date, content, id) VALUES (?,?,?,?,?,?)");
|
||||
$stmt->execute([$username,"root","root",microtime(true) - $ref,$postie,bin2hex(random_bytes(16))]);
|
||||
|
||||
header("Location: " . $_SERVER["REQUEST_URI"]);
|
||||
die();
|
||||
}
|
||||
|
||||
page_header();
|
||||
|
|
Loading…
Reference in a new issue