From 4c4754e64bdb6eb04084fe82b6d7b579bd84f916 Mon Sep 17 00:00:00 2001 From: Exile Date: Sun, 3 Aug 2014 02:47:43 +0400 Subject: [PATCH] r593 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Фикс построения списка файлов в раздаче, в случае если торрент немного некорректно бенкодируется. --- upload/ajax/view_torrent.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/upload/ajax/view_torrent.php b/upload/ajax/view_torrent.php index e339acc90..5f9ed7227 100644 --- a/upload/ajax/view_torrent.php +++ b/upload/ajax/view_torrent.php @@ -10,6 +10,9 @@ if (!isset($this->request['attach_id'])) } $attach_id = (int) $this->request['attach_id']; +global $bnc_error; +$bnc_error = 0; + $torrent = DB()->fetch_row("SELECT at.attach_id, at.physical_filename FROM ". BB_ATTACHMENTS_DESC ." at WHERE at.attach_id = $attach_id LIMIT 1"); if (!$torrent) $this->ajax_die($lang['EMPTY_ATTACH_ID']); $filename = get_attachments_dir() .'/'. $torrent['physical_filename']; @@ -126,7 +129,8 @@ class torrent { if (is_string($cur_files_ary)) { - bb_die($lang['ERROR_BUILD']); + $GLOBALS['bnc_error'] = 1; + break(1); } $cur_files_ary[] = $this->build_file_item($name, $length); } @@ -169,4 +173,6 @@ function clean_tor_dirname ($dirname) return str_replace(array('[', ']', '<', '>', "'"), array('[', ']', '<', '>', '''), $dirname); } +if ($bnc_error) $tor_filelist = ''.$lang['ERROR_BUILD'].'

'.$tor_filelist; + $this->response['html'] = $tor_filelist; \ No newline at end of file