mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-22 22:33:55 -07:00
r593
Фикс построения списка файлов в раздаче, в случае если торрент немного некорректно бенкодируется.
This commit is contained in:
parent
375f9c2dd2
commit
4c4754e64b
1 changed files with 7 additions and 1 deletions
|
@ -10,6 +10,9 @@ if (!isset($this->request['attach_id']))
|
||||||
}
|
}
|
||||||
$attach_id = (int) $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");
|
$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']);
|
if (!$torrent) $this->ajax_die($lang['EMPTY_ATTACH_ID']);
|
||||||
$filename = get_attachments_dir() .'/'. $torrent['physical_filename'];
|
$filename = get_attachments_dir() .'/'. $torrent['physical_filename'];
|
||||||
|
@ -126,7 +129,8 @@ class torrent
|
||||||
{
|
{
|
||||||
if (is_string($cur_files_ary))
|
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);
|
$cur_files_ary[] = $this->build_file_item($name, $length);
|
||||||
}
|
}
|
||||||
|
@ -169,4 +173,6 @@ function clean_tor_dirname ($dirname)
|
||||||
return str_replace(array('[', ']', '<', '>', "'"), array('[', ']', '<', '>', '''), $dirname);
|
return str_replace(array('[', ']', '<', '>', "'"), array('[', ']', '<', '>', '''), $dirname);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($bnc_error) $tor_filelist = '<b style="color: #993300;">'.$lang['ERROR_BUILD'].'</b><br /><br />'.$tor_filelist;
|
||||||
|
|
||||||
$this->response['html'] = $tor_filelist;
|
$this->response['html'] = $tor_filelist;
|
Loading…
Add table
Add a link
Reference in a new issue