Minor improvements (#1307)

* Minor improvements

* Updated

* Update Attach.php

* Update posting_attachments.php

* Update change_tor_status.php

* Updated
This commit is contained in:
Roman Kelesidis 2024-01-05 00:20:51 +07:00 committed by GitHub
commit f456c827d7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 27 additions and 28 deletions

View file

@ -13,13 +13,15 @@ if (!defined('IN_AJAX')) {
global $userdata, $bb_cfg, $lang;
if (!isset($this->request['attach_id'])) {
if (!$attach_id = (int)$this->request['attach_id']) {
$this->ajax_die($lang['EMPTY_ATTACH_ID']);
}
$attach_id = (int)$this->request['attach_id'];
$mode = (string)$this->request['mode'];
if (!$mode = (string)$this->request['mode']) {
$this->ajax_die('invalid mode (empty)');
}
$comment = false;
if ($bb_cfg['tor_comment']) {
$comment = (string)$this->request['comment'];
}
@ -117,6 +119,9 @@ switch ($mode) {
send_pm($tor['checked_user_id'], $subject, $message, $userdata['user_id']);
\TorrentPier\Sessions::cache_rm_user_sessions($tor['checked_user_id']);
break;
default:
$this->ajax_die('Invalid mode: ' . $mode);
}
$this->response['attach_id'] = $attach_id;