Don't requires fill textarea for mod comment deleting (#1433)

* Don't requires fill textarea for mod comment deleting

* Update CHANGELOG.md
This commit is contained in:
Roman Kelesidis 2024-03-27 18:45:48 +07:00 committed by GitHub
commit 1f08637a1f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 18 deletions

View file

@ -16,7 +16,7 @@ global $lang, $userdata;
$post_id = (int)$this->request['post_id'];
$mc_type = (int)$this->request['mc_type'];
$mc_text = (string)$this->request['mc_text'];
if (!$mc_text = prepare_message($mc_text)) {
if ($mc_type != 0 && !$mc_text = prepare_message($mc_text)) {
$this->ajax_die($lang['EMPTY_MESSAGE']);
}
@ -46,23 +46,13 @@ if ($mc_type && $post['poster_id'] != $userdata['user_id']) {
\TorrentPier\Sessions::cache_rm_user_sessions($post['poster_id']);
}
switch ($mc_type) {
case 1: // Комментарий
$mc_class = 'success';
break;
case 2: // Информация
$mc_class = 'info';
break;
case 3: // Предупреждение
$mc_class = 'warning';
break;
case 4: // Нарушение
$mc_class = 'danger';
break;
default:
$mc_class = '';
break;
}
$mc_class = match ($mc_type) {
1 => 'success',
2 => 'info',
3 => 'warning',
4 => 'danger',
default => '',
};
$this->response['mc_type'] = $mc_type;
$this->response['post_id'] = $post_id;