1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

[ticket/12938] Remove the 'Download all attachments' feature.

PHPBB3-12938
This commit is contained in:
Andreas Fischer
2014-08-09 12:01:09 +02:00
parent deaa0a8c75
commit 12caf2f03d
9 changed files with 8 additions and 300 deletions

View File

@@ -1420,44 +1420,6 @@ function get_user_rank($user_rank, $user_posts, &$rank_title, &$rank_img, &$rank
}
}
/**
* Generate a list of archive types available for compressing attachments
*
* @param string $param_key Either topic_id or post_id
* @param string $param_val The value of the topic or post id
* @param string $phpbb_root_path The root path of the phpBB installation
* @param string $phpEx The PHP file extension
*
* @return array Array containing the link and the type of compression
*/
function phpbb_gen_download_links($param_key, $param_val, $phpbb_root_path, $phpEx)
{
if (!class_exists('compress'))
{
require $phpbb_root_path . 'includes/functions_compress.' . $phpEx;
}
$methods = compress::methods();
// Sort by preferred type.
$methods = array_intersect(array('.zip', '.tar.bz2', '.tar.gz', '.tar'), $methods);
$links = array();
foreach ($methods as $method)
{
$exploded = explode('.', $method);
$type = array_pop($exploded);
$params = array('archive' => $method);
$params[$param_key] = $param_val;
$links[] = array(
'LINK' => append_sid("{$phpbb_root_path}download/file.$phpEx", $params),
'TYPE' => $type,
);
}
return $links;
}
/**
* Prepare profile data
*/

View File

@@ -717,27 +717,6 @@ function phpbb_download_check_pm_auth($db, $user_id, $msg_id)
return $allowed;
}
/**
* Cleans a filename of any characters that could potentially cause a problem on
* a user's filesystem.
*
* @param string $filename The filename to clean
*
* @return string The cleaned filename
*/
function phpbb_download_clean_filename($filename)
{
$bad_chars = array("'", "\\", ' ', '/', ':', '*', '?', '"', '<', '>', '|');
// rawurlencode to convert any potentially 'bad' characters that we missed
$filename = rawurlencode(str_replace($bad_chars, '_', $filename));
// Turn the %xx entities created by rawurlencode to _
$filename = preg_replace("/%(\w{2})/", '_', $filename);
return $filename;
}
/**
* Check if the browser is internet explorer version 7+
*

View File

@@ -250,7 +250,6 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)
'U_PM_ACTION' => $url . '&amp;mode=compose&amp;f=' . $folder_id . '&amp;p=' . $message_row['msg_id'],
'S_HAS_ATTACHMENTS' => (sizeof($attachments)) ? true : false,
'S_HAS_MULTIPLE_ATTACHMENTS' => (sizeof($attachments) > 1),
'S_DISPLAY_NOTICE' => $display_notice && $message_row['message_attachment'],
'S_AUTHOR_DELETED' => ($author_id == ANONYMOUS) ? true : false,
'S_SPECIAL_FOLDER' => in_array($folder_id, array(PRIVMSGS_NO_BOX, PRIVMSGS_OUTBOX)),
@@ -339,12 +338,6 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)
// Display not already displayed Attachments for this post, we already parsed them. ;)
if (isset($attachments) && sizeof($attachments))
{
$methods = phpbb_gen_download_links('msg_id', $msg_id, $phpbb_root_path, $phpEx);
foreach ($methods as $method)
{
$template->assign_block_vars('dl_method', $method);
}
foreach ($attachments as $attachment)
{
$template->assign_block_vars('attachment', array(