aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/functions.php16
-rw-r--r--phpBB/includes/functions_acp.php2
-rw-r--r--phpBB/includes/functions_display.php38
-rw-r--r--phpBB/includes/functions_download.php21
-rw-r--r--phpBB/includes/ucp/ucp_pm_viewmessage.php7
5 files changed, 15 insertions, 69 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 4318b20b97..bd0a5795b1 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -5095,9 +5095,10 @@ function phpbb_check_and_display_sql_report(\phpbb\request\request_interface $re
* @param \phpbb\config\config $config Config object
* @param \phpbb\auth\auth $auth Auth object
* @param \phpbb\user $user User object
+* @param \phpbb\event\dispatcher_interface $phpbb_dispatcher Event dispatcher
* @return string
*/
-function phpbb_generate_debug_output(phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\auth\auth $auth, \phpbb\user $user)
+function phpbb_generate_debug_output(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\auth\auth $auth, \phpbb\user $user, \phpbb\event\dispatcher_interface $phpbb_dispatcher)
{
$debug_info = array();
@@ -5136,6 +5137,17 @@ function phpbb_generate_debug_output(phpbb\db\driver\driver_interface $db, \phpb
}
}
+ /**
+ * Modify debug output information
+ *
+ * @event core.phpbb_generate_debug_output
+ * @var array debug_info Array of strings with debug information
+ *
+ * @since 3.1.0-RC3
+ */
+ $vars = array('debug_info');
+ extract($phpbb_dispatcher->trigger_event('core.phpbb_generate_debug_output', compact($vars)));
+
return implode(' | ', $debug_info);
}
@@ -5174,7 +5186,7 @@ function page_footer($run_cron = true, $display_template = true, $exit_handler =
phpbb_check_and_display_sql_report($request, $auth, $db);
$template->assign_vars(array(
- 'DEBUG_OUTPUT' => phpbb_generate_debug_output($db, $config, $auth, $user),
+ 'DEBUG_OUTPUT' => phpbb_generate_debug_output($db, $config, $auth, $user, $phpbb_dispatcher),
'TRANSLATION_INFO' => (!empty($user->lang['TRANSLATION_INFO'])) ? $user->lang['TRANSLATION_INFO'] : '',
'CREDIT_LINE' => $user->lang('POWERED_BY', '<a href="https://www.phpbb.com/">phpBB</a>&reg; Forum Software &copy; phpBB Limited'),
diff --git a/phpBB/includes/functions_acp.php b/phpBB/includes/functions_acp.php
index abf726581d..dc3d745d53 100644
--- a/phpBB/includes/functions_acp.php
+++ b/phpBB/includes/functions_acp.php
@@ -149,7 +149,7 @@ function adm_page_footer($copyright_html = true)
phpbb_check_and_display_sql_report($request, $auth, $db);
$template->assign_vars(array(
- 'DEBUG_OUTPUT' => phpbb_generate_debug_output($db, $config, $auth, $user),
+ 'DEBUG_OUTPUT' => phpbb_generate_debug_output($db, $config, $auth, $user, $phpbb_dispatcher),
'TRANSLATION_INFO' => (!empty($user->lang['TRANSLATION_INFO'])) ? $user->lang['TRANSLATION_INFO'] : '',
'S_COPYRIGHT_HTML' => $copyright_html,
'CREDIT_LINE' => $user->lang('POWERED_BY', '<a href="https://www.phpbb.com/">phpBB</a>&reg; Forum Software &copy; phpBB Limited'),
diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php
index 62f218cf60..78137d075b 100644
--- a/phpBB/includes/functions_display.php
+++ b/phpBB/includes/functions_display.php
@@ -1421,44 +1421,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
*/
function phpbb_show_profile($data, $user_notes_enabled = false, $warn_user_enabled = false)
diff --git a/phpBB/includes/functions_download.php b/phpBB/includes/functions_download.php
index 7a7efd5b34..4ff3994f4c 100644
--- a/phpBB/includes/functions_download.php
+++ b/phpBB/includes/functions_download.php
@@ -718,27 +718,6 @@ function phpbb_download_check_pm_auth($db, $user_id, $msg_id)
}
/**
-* 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+
*
* @param string $user_agent User agent HTTP header
diff --git a/phpBB/includes/ucp/ucp_pm_viewmessage.php b/phpBB/includes/ucp/ucp_pm_viewmessage.php
index 94383b935f..d5a1dbae87 100644
--- a/phpBB/includes/ucp/ucp_pm_viewmessage.php
+++ b/phpBB/includes/ucp/ucp_pm_viewmessage.php
@@ -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(