Revert "fix names??"
This reverts commit 3f1633733b0091356916aac3c176c2f4537aac01.
This commit is contained in:
parent
944f240e89
commit
89a5905982
@ -14,8 +14,6 @@ $config = require 'config.php';
|
|||||||
$boardId = $_GET['board'] ?? 'b';
|
$boardId = $_GET['board'] ?? 'b';
|
||||||
$threadId = isset($_GET['thread']) ? urldecode($_GET['thread']) : null;
|
$threadId = isset($_GET['thread']) ? urldecode($_GET['thread']) : null;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$db = new PDO(
|
$db = new PDO(
|
||||||
"mysql:host={$config['db']['host']};dbname={$config['db']['name']}",
|
"mysql:host={$config['db']['host']};dbname={$config['db']['name']}",
|
||||||
@ -130,7 +128,7 @@ if ($threadId) {
|
|||||||
$posts = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
$posts = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||||
|
|
||||||
if (empty($posts)) {
|
if (empty($posts)) {
|
||||||
header('Location: board.php?board=' . urlencode($boardId));
|
header('Location: board.php?board=' . $boardId);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
} catch (PDOException $e) {
|
} catch (PDOException $e) {
|
||||||
|
@ -96,13 +96,15 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
|||||||
');
|
');
|
||||||
$stmt->execute([$threadId, $boardId, $title, $description, $fileName, $fileSize, $fileType, $ip, $anonymousId]);
|
$stmt->execute([$threadId, $boardId, $title, $description, $fileName, $fileSize, $fileType, $ip, $anonymousId]);
|
||||||
|
|
||||||
|
if ($message) {
|
||||||
$stmt = $db->prepare('
|
$stmt = $db->prepare('
|
||||||
INSERT INTO posts (post_id, thread_id, board_id, message, file_name, file_size, file_type, ip_address, anonymous_id)
|
INSERT INTO posts (post_id, thread_id, board_id, message, ip_address, anonymous_id)
|
||||||
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
|
VALUES (?, ?, ?, ?, ?, ?)
|
||||||
');
|
');
|
||||||
$stmt->execute([$postId, $threadId, $boardId, $message, $fileName, $fileSize, $fileType, $ip, $anonymousId]);
|
$stmt->execute([$postId, $threadId, $boardId, $message, $ip, $anonymousId]);
|
||||||
|
}
|
||||||
|
|
||||||
header('Location: board.php?board=' . urlencode($boardId) . '&thread=' . urlencode($threadId));
|
header('Location: board.php?board=' . $boardId . '&thread=' . $threadId);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user