diff --git a/CHANGELOG.md b/CHANGELOG.md index d7b18a375..3f32e037e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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)) diff --git a/library/ajax/post_mod_comment.php b/library/ajax/post_mod_comment.php index a68fce99e..75af51d3e 100644 --- a/library/ajax/post_mod_comment.php +++ b/library/ajax/post_mod_comment.php @@ -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;