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

@ -13,6 +13,7 @@
- Added support for rutracker font BBCode tag [\#1397](https://github.com/torrentpier/torrentpier/pull/1397) ([belomaxorka](https://github.com/belomaxorka))
- Added mod "Reason to move topic" [\#1388](https://github.com/torrentpier/torrentpier/pull/1388) ([belomaxorka](https://github.com/belomaxorka))
- Created template file for AJAX quick actions [\#1381](https://github.com/torrentpier/torrentpier/pull/1381) ([belomaxorka](https://github.com/belomaxorka))
- Don't requires fill textarea for mod comment deleting [\#1433](https://github.com/torrentpier/torrentpier/pull/1433) ([belomaxorka](https://github.com/belomaxorka))
- Make post date clickable in `posting.php` [\#1427](https://github.com/torrentpier/torrentpier/pull/1427) ([belomaxorka](https://github.com/belomaxorka))
- Removed `wbr()` [\#1387](https://github.com/torrentpier/torrentpier/pull/1387) ([belomaxorka](https://github.com/belomaxorka))
- Removed converting for legacy md5 passwords [\#1386](https://github.com/torrentpier/torrentpier/pull/1386) ([belomaxorka](https://github.com/belomaxorka))

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;