fix names??

This commit is contained in:
Lain Iwakura 2025-07-24 06:56:11 +03:00
parent d753572254
commit 3f1633733b
No known key found for this signature in database
GPG Key ID: C7C18257F2ADC6F8
2 changed files with 9 additions and 9 deletions

View File

@ -14,6 +14,8 @@ $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']}",
@ -124,7 +126,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=' . $boardId); header('Location: board.php?board=' . urlencode($boardId));
exit; exit;
} }
} catch (PDOException $e) { } catch (PDOException $e) {

View File

@ -96,15 +96,13 @@ 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=' . $boardId . '&thread=' . $threadId); header('Location: board.php?board=' . urlencode($boardId) . '&thread=' . urlencode($threadId));
exit; exit;
} }
} else { } else {