в папку uploads/comments/ при создании запишется index.php

This commit is contained in:
2025-12-22 16:32:12 +05:00
parent 244b0fb2ce
commit 3c0273b236
2 changed files with 20 additions and 9 deletions

View File

@@ -448,12 +448,23 @@ function commentListShow($tpl_dir)
{
$upload_path = BASE_DIR . '/uploads/comments/';
// Создаем папку, если её нет
if (!is_dir($upload_path)) {
@mkdir($upload_path, 0775, true);
// Создаем пустой index.html для безопасности (запрет листинга папки)
@file_put_contents($upload_path . 'index.html', '');
}
// Создаем папку, если её нет
if (!is_dir($upload_path)) {
@mkdir($upload_path, 0775, true);
// Содержимое для защитного файла index.php
$index_content = "<?php
/**
* Файл-заглушка, предназначенный для запрета показа списка файлов в текущей директории,
* если через адресную строку браузера было прямое обращение к данной директории.
*/
header('Location:/');
exit;
?>";
// Создаем index.php для безопасности (запрет листинга папки и редирект)
@file_put_contents($upload_path . 'index.php', $index_content);
}
$allowed_mime = ['image/jpeg', 'image/png', 'image/gif'];
$file_info = @getimagesize($_FILES['comment_image']['tmp_name']);

View File

@@ -166,7 +166,7 @@
display: flex !important;
align-items: center !important;
/* ПРИЖИМАЕМ КНОПКИ ВПРАВО */
justify-content: flex-end !important;
/* justify-content: flex-end !important; */
/* ФИКСИРОВАННАЯ ВЫСОТА (чтобы не прыгало как на Screenshot 5) */
min-height: 48px !important;
@@ -187,9 +187,9 @@
}
/* Гарантируем, что текст таймера тоже будет справа */
[id^="timer_container_"] {
/*[id^="timer_container_"] {
text-align: right !important;
}
}*/
/* Если нужно, чтобы кнопки "Ответить" и "Удалить" были разнесены (одну влево, другие вправо) */
/* .mod_comment_footer { justify-content: space-between !important; } */