Minor improvements (#920)

This commit is contained in:
Roman Kelesidis 2023-09-30 19:25:57 +07:00 committed by GitHub
commit 82e5829426
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 8 deletions

View file

@ -559,12 +559,12 @@ $bb_cfg['attach'] = [
'max_size' => 5 * 1024 * 1024, // максимальный размер файла в байтах 'max_size' => 5 * 1024 * 1024, // максимальный размер файла в байтах
]; ];
$bb_cfg['tor_forums_allowed_ext'] = ['torrent', 'zip', 'rar']; // для разделов с раздачами $bb_cfg['tor_forums_allowed_ext'] = ['torrent', 'zip', 'rar']; // TODO: для разделов с раздачами
$bb_cfg['gen_forums_allowed_ext'] = ['zip', 'rar']; // для обычных разделов $bb_cfg['gen_forums_allowed_ext'] = ['zip', 'rar']; // TODO: для обычных разделов
// Avatars // Avatars
$bb_cfg['avatars'] = [ $bb_cfg['avatars'] = [
'allowed_ext' => ['gif', 'jpg', 'jpeg', 'png'], // разрешенные форматы файлов 'allowed_ext' => ['gif', 'jpg', 'jpeg', 'png', 'webp', 'bmp'], // разрешенные форматы файлов
'bot_avatar' => '/gallery/bot.gif', // аватара бота 'bot_avatar' => '/gallery/bot.gif', // аватара бота
'max_size' => 100 * 1024, // размер аватары в байтах 'max_size' => 100 * 1024, // размер аватары в байтах
'max_height' => 100, // высота аватара в px 'max_height' => 100, // высота аватара в px
@ -577,7 +577,7 @@ $bb_cfg['avatars'] = [
// Group avatars // Group avatars
$bb_cfg['group_avatars'] = [ $bb_cfg['group_avatars'] = [
'allowed_ext' => ['gif', 'jpg', 'jpeg', 'png'], // разрешенные форматы файлов 'allowed_ext' => ['gif', 'jpg', 'jpeg', 'png', 'webp', 'bmp'], // разрешенные форматы файлов
'max_size' => 300 * 1024, // размер аватары в байтах 'max_size' => 300 * 1024, // размер аватары в байтах
'max_height' => 300, // высота аватара в px 'max_height' => 300, // высота аватара в px
'max_width' => 300, // ширина аватара в px 'max_width' => 300, // ширина аватара в px

View file

@ -547,7 +547,7 @@ switch ($mode) {
$poster_id = $postrow[$i]['poster_id']; $poster_id = $postrow[$i]['poster_id'];
$poster = $postrow[$i]['username']; $poster = $postrow[$i]['username'];
$post_date = bb_date($postrow[$i]['post_time']); $post_date = bb_date($postrow[$i]['post_time'], $bb_cfg['post_date_format']);
$message = $postrow[$i]['post_text']; $message = $postrow[$i]['post_text'];

View file

@ -76,7 +76,7 @@ class BBCode
private function init_replacements(): void private function init_replacements(): void
{ {
$tpl = $this->tpl; $tpl = $this->tpl;
$img_exp = '(https?:)?//[^\s\?&;=\#\"<>]+?\.(jpg|jpeg|gif|png)([a-z0-9/?&%;][^\[\]]*)?'; $img_exp = '(https?:)?//[^\s\?&;=\#\"<>]+?\.(jpg|jpeg|gif|png|bmp)([a-z0-9/?&%;][^\[\]]*)?';
$email_exp = '[a-z0-9&\-_.]+?@[\w\-]+\.([\w\-\.]+\.)?[\w]+'; $email_exp = '[a-z0-9&\-_.]+?@[\w\-]+\.([\w\-\.]+\.)?[\w]+';
$this->preg = [ $this->preg = [

View file

@ -374,8 +374,8 @@ var TPL = {
reg: { reg: {
num : /^\d+$/, num : /^\d+$/,
URL : /^https?:\/\/[\w\#$%&~/.\-;:=?@\[\]+]+$/i, URL : /^https?:\/\/[\w\#$%&~/.\-;:=?@\[\]+]+$/i,
img : /^https?:\/\/[^\s\?&;:=\#\"<>]+\.(jpg|jpeg|gif|png)$/i, img : /^https?:\/\/[^\s\?&;:=\#\"<>]+\.(jpg|jpeg|gif|png|bmp)$/i,
img_tag : /(https?:\/\/[^\s\?&;:=\#\"<>]+\.(jpg|jpeg|gif|png)(?!\[|\]|\.))/ig img_tag : /(https?:\/\/[^\s\?&;:=\#\"<>]+\.(jpg|jpeg|gif|png|bmp)(?!\[|\]|\.))/ig
}, },
// построение сообщения на основе данных из формы // построение сообщения на основе данных из формы