mirror of
https://github.com/torrentpier/torrentpier-lts.git
synced 2025-02-28 15:10:54 +03:00
Attachment system bugfix (#141)
This commit is contained in:
parent
35ddccfc12
commit
f1c8246ab7
6
ajax.php
6
ajax.php
@ -29,12 +29,8 @@ switch ($ajax->action)
|
|||||||
case 'view_torrent':
|
case 'view_torrent':
|
||||||
case 'mod_action':
|
case 'mod_action':
|
||||||
case 'change_tor_status':
|
case 'change_tor_status':
|
||||||
case 'gen_passkey':
|
|
||||||
require(ATTACH_DIR . 'attachment_mod.php');
|
|
||||||
require(INC_DIR . 'functions_torrent.php');
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'change_torrent':
|
case 'change_torrent':
|
||||||
|
case 'gen_passkey':
|
||||||
require(ATTACH_DIR . 'attachment_mod.php');
|
require(ATTACH_DIR . 'attachment_mod.php');
|
||||||
require(INC_DIR . 'functions_torrent.php');
|
require(INC_DIR . 'functions_torrent.php');
|
||||||
break;
|
break;
|
||||||
|
@ -547,9 +547,11 @@ function get_var($var_name, $default, $multibyte = false)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
list($key_type, $type) = each($default);
|
foreach ($default as $key_type => $type)
|
||||||
$type = gettype($type);
|
{
|
||||||
$key_type = gettype($key_type);
|
$key_type = gettype($key_type);
|
||||||
|
$type = gettype($type);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_array($var))
|
if (is_array($var))
|
||||||
|
@ -975,7 +975,7 @@ class attach_parent
|
|||||||
$this->attach_filename = preg_replace('#([\xC2\xC3])([\x80-\xBF])#', 'chr(ord(\'$1\')<<6&0xC0|ord(\'$2\')&0x3F)', $this->attach_filename);
|
$this->attach_filename = preg_replace('#([\xC2\xC3])([\x80-\xBF])#', 'chr(ord(\'$1\')<<6&0xC0|ord(\'$2\')&0x3F)', $this->attach_filename);
|
||||||
$this->attach_filename = rawurlencode($this->attach_filename);
|
$this->attach_filename = rawurlencode($this->attach_filename);
|
||||||
$this->attach_filename = preg_replace("/(%[0-9A-F]{1,2})/i", '', $this->attach_filename);
|
$this->attach_filename = preg_replace("/(%[0-9A-F]{1,2})/i", '', $this->attach_filename);
|
||||||
$this->attach_filename = trim($this->attach_filename);
|
$this->attach_filename = trim($this->attach_filename . time());
|
||||||
}
|
}
|
||||||
$this->attach_filename = str_replace(array('&','&',' '), '_', $this->attach_filename);
|
$this->attach_filename = str_replace(array('&','&',' '), '_', $this->attach_filename);
|
||||||
$this->attach_filename = str_replace('php', '_php_', $this->attach_filename);
|
$this->attach_filename = str_replace('php', '_php_', $this->attach_filename);
|
||||||
|
@ -121,6 +121,7 @@ if (!$t_data = DB()->fetch_row($sql))
|
|||||||
$forum_topic_data =& $t_data;
|
$forum_topic_data =& $t_data;
|
||||||
$topic_id = $t_data['topic_id'];
|
$topic_id = $t_data['topic_id'];
|
||||||
$forum_id = $t_data['forum_id'];
|
$forum_id = $t_data['forum_id'];
|
||||||
|
$topic_attachment = isset($t_data['topic_attachment']) ? (int)$t_data['topic_attachment'] : null;
|
||||||
|
|
||||||
if($t_data['allow_porno_topic'] && bf($userdata['user_opt'], 'user_opt', 'user_porn_forums')) bb_die($lang['ERROR_PORNO_FORUM']);
|
if($t_data['allow_porno_topic'] && bf($userdata['user_opt'], 'user_opt', 'user_porn_forums')) bb_die($lang['ERROR_PORNO_FORUM']);
|
||||||
|
|
||||||
@ -131,7 +132,7 @@ if ($userdata['session_admin'] && !empty($_REQUEST['mod']))
|
|||||||
$datastore->enqueue(array('viewtopic_forum_select'));
|
$datastore->enqueue(array('viewtopic_forum_select'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($t_data['topic_attachment'])
|
if ($topic_attachment)
|
||||||
{
|
{
|
||||||
$datastore->enqueue(array(
|
$datastore->enqueue(array(
|
||||||
'attach_extensions',
|
'attach_extensions',
|
||||||
@ -606,7 +607,7 @@ $template->assign_vars(array(
|
|||||||
));
|
));
|
||||||
require(INC_DIR .'torrent_show_dl_list.php');
|
require(INC_DIR .'torrent_show_dl_list.php');
|
||||||
|
|
||||||
if ($t_data['topic_attachment'])
|
if ($topic_attachment)
|
||||||
{
|
{
|
||||||
require(ATTACH_DIR .'attachment_mod.php');
|
require(ATTACH_DIR .'attachment_mod.php');
|
||||||
init_display_post_attachments($t_data['topic_attachment']);
|
init_display_post_attachments($t_data['topic_attachment']);
|
||||||
|
Loading…
Reference in New Issue
Block a user