diff --git a/posting.php b/posting.php index 01e8d1caf..34234fd79 100644 --- a/posting.php +++ b/posting.php @@ -327,6 +327,13 @@ if (($delete || $mode == 'delete') && !$confirm) { $attach_rg_sig = (isset($_POST['attach_rg_sig'], $_POST['poster_rg']) && $_POST['poster_rg'] != -1) ? 1 : 0; $poster_rg_id = (isset($_POST['poster_rg']) && $_POST['poster_rg'] != -1) ? (int)$_POST['poster_rg'] : 0; + // Disable edit release if tor_status in $bb_cfg['tor_cannot_edit'] + if ($post_info['allow_reg_tracker'] && $post_data['first_post'] && !empty($bb_cfg['tor_cannot_edit']) /*&& !IS_AM*/) { + if ($tor_status = DB()->fetch_row("SELECT tor_status FROM " . BB_BT_TORRENTS . " WHERE topic_id = $topic_id AND forum_id = $forum_id AND tor_status IN(" . implode(',', array_keys($bb_cfg['tor_cannot_edit'])) . ") LIMIT 1")) { + bb_die('Вы не можете редактировать релиз, если он имеет статус: ' . '' . $bb_cfg['tor_icons'][$tor_status['tor_status']] . ' ' . $lang['TOR_STATUS_NAME'][$tor_status['tor_status']] . '.'); + } + } + \TorrentPier\Legacy\Post::prepare_post($mode, $post_data, $error_msg, $username, $subject, $message); if (!$error_msg) { diff --git a/src/Legacy/Template.php b/src/Legacy/Template.php index 1e08f4dd5..9a1c3b450 100644 --- a/src/Legacy/Template.php +++ b/src/Legacy/Template.php @@ -982,7 +982,7 @@ class Template */ public function write_cache($filename, $code) { - file_write($code, $filename, false, true, true); + file_write($code, $filename, max_size: false, replace_content: true); } public function xs_startup() diff --git a/styles/templates/default/usercp_register.tpl b/styles/templates/default/usercp_register.tpl index 42eaee856..0e652f75f 100644 --- a/styles/templates/default/usercp_register.tpl +++ b/styles/templates/default/usercp_register.tpl @@ -156,7 +156,7 @@