fix names??

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

View File

@ -12,7 +12,7 @@ if (!isset($_SESSION['authenticated'])) {
$config = require 'config.php'; $config = require 'config.php';
$boardId = $_GET['board'] ?? 'b'; $boardId = $_GET['board'] ?? 'b';
$threadId = $_GET['thread'] ?? null; $threadId = isset($_GET['thread']) ? urldecode($_GET['thread']) : null;
try { try {
$db = new PDO( $db = new PDO(
@ -181,7 +181,7 @@ function formatMessage($message) {
<div class="thread-container"> <div class="thread-container">
<div class="thread-header"> <div class="thread-header">
<h2><?= htmlspecialchars($posts[0]['thread_title'] ?? 'Без названия') ?></h2> <h2><?= htmlspecialchars($posts[0]['thread_title'] ?? 'Без названия') ?></h2>
<a href="board.php?board=<?= htmlspecialchars($boardId) ?>" class="back-link"> Назад к списку</a> <a href="board.php?board=<?= urlencode($boardId) ?>" class="back-link"> Назад к списку</a>
</div> </div>
<div class="posts-container" id="posts"> <div class="posts-container" id="posts">
@ -220,7 +220,7 @@ function formatMessage($message) {
<?php foreach ($threads as $thread): ?> <?php foreach ($threads as $thread): ?>
<div class="thread-item"> <div class="thread-item">
<div class="thread-header"> <div class="thread-header">
<a href="board.php?board=<?= htmlspecialchars($boardId) ?>&thread=<?= htmlspecialchars($thread['thread_id']) ?>" class="thread-link"> <a href="board.php?board=<?= urlencode($boardId) ?>&thread=<?= urlencode($thread['thread_id']) ?>" class="thread-link">
<span class="thread-title"><?= htmlspecialchars($thread['title'] ?? 'Без названия') ?></span> <span class="thread-title"><?= htmlspecialchars($thread['title'] ?? 'Без названия') ?></span>
</a> </a>
<span class="thread-info"> <span class="thread-info">
@ -252,7 +252,7 @@ function formatMessage($message) {
<?php if (!$threadId): ?> <?php if (!$threadId): ?>
<div class="new-thread-button"> <div class="new-thread-button">
<a href="newthread.php?board=<?= htmlspecialchars($boardId) ?>" class="new-thread-btn">Создать новый тред</a> <a href="newthread.php?board=<?= urlencode($boardId) ?>" class="new-thread-btn">Создать новый тред</a>
</div> </div>
<?php else: ?> <?php else: ?>
<div class="post-form"> <div class="post-form">

View File

@ -4,7 +4,6 @@ header('Content-Type: text/html; charset=utf-8');
header('X-Content-Type-Options: nosniff'); header('X-Content-Type-Options: nosniff');
header('X-Frame-Options: DENY'); header('X-Frame-Options: DENY');
header('X-XSS-Protection: 1; mode=block'); header('X-XSS-Protection: 1; mode=block');
header('Content-Type: text/html; charset=utf-8');
$config = require 'config.php'; $config = require 'config.php';
@ -155,7 +154,7 @@ if (isset($_GET['logout'])) {
<div class="boards-list"> <div class="boards-list">
<?php foreach ($boards as $board): ?> <?php foreach ($boards as $board): ?>
<div class="board-item"> <div class="board-item">
<a href="board.php?board=<?= htmlspecialchars($board['board_id']) ?>" class="board-link"> <a href="board.php?board=<?= urlencode($board['board_id']) ?>" class="board-link">
<span class="board-id">/<?= htmlspecialchars($board['board_id']) ?>/</span> <span class="board-id">/<?= htmlspecialchars($board['board_id']) ?>/</span>
<span class="board-name"><?= htmlspecialchars($board['name']) ?></span> <span class="board-name"><?= htmlspecialchars($board['name']) ?></span>
<span class="board-desc"><?= htmlspecialchars($board['description']) ?></span> <span class="board-desc"><?= htmlspecialchars($board['description']) ?></span>

View File

@ -11,7 +11,7 @@ if (!isset($_SESSION['authenticated'])) {
} }
$config = require 'config.php'; $config = require 'config.php';
$boardId = $_GET['board'] ?? 'b'; $boardId = isset($_GET['board']) ? urldecode($_GET['board']) : 'b';
try { try {
$db = new PDO( $db = new PDO(
@ -126,7 +126,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
<div class="header"> <div class="header">
<h1><a href="index.php" class="home-link">mkach</a> - Создать тред в /<?= htmlspecialchars($boardId) ?>/</h1> <h1><a href="index.php" class="home-link">mkach</a> - Создать тред в /<?= htmlspecialchars($boardId) ?>/</h1>
<div class="header-buttons"> <div class="header-buttons">
<a href="board.php?board=<?= htmlspecialchars($boardId) ?>" class="boards-btn"> Назад</a> <a href="board.php?board=<?= urlencode($boardId) ?>" class="boards-btn"> Назад</a>
<a href="index.php" class="boards-btn">Доски</a> <a href="index.php" class="boards-btn">Доски</a>
<a href="?logout=1" class="logout-btn">Выход</a> <a href="?logout=1" class="logout-btn">Выход</a>
</div> </div>
@ -162,7 +162,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
<div class="form-row"> <div class="form-row">
<button type="submit" class="send-btn">Создать тред</button> <button type="submit" class="send-btn">Создать тред</button>
<a href="board.php?board=<?= htmlspecialchars($boardId) ?>" class="cancel-btn">Отмена</a> <a href="board.php?board=<?= urlencode($boardId) ?>" class="cancel-btn">Отмена</a>
</div> </div>
</form> </form>
</div> </div>