aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/includes/functions_download.php22
-rw-r--r--phpBB/includes/functions_user.php16
-rw-r--r--phpBB/phpbb/di/proxy_instantiator.php7
-rw-r--r--phpBB/viewforum.php4
4 files changed, 40 insertions, 9 deletions
diff --git a/phpBB/includes/functions_download.php b/phpBB/includes/functions_download.php
index d68709f2f8..e00be1e01a 100644
--- a/phpBB/includes/functions_download.php
+++ b/phpBB/includes/functions_download.php
@@ -124,7 +124,7 @@ function wrap_img_in_html($src, $title)
*/
function send_file_to_browser($attachment, $upload_dir, $category)
{
- global $user, $db, $phpbb_root_path, $request;
+ global $user, $db, $phpbb_dispatcher, $phpbb_root_path, $request;
$filename = $phpbb_root_path . $upload_dir . '/' . $attachment['physical_filename'];
@@ -149,6 +149,26 @@ function send_file_to_browser($attachment, $upload_dir, $category)
// Now send the File Contents to the Browser
$size = @filesize($filename);
+ /**
+ * Event to alter attachment before it is sent to browser.
+ *
+ * @event core.send_file_to_browser_before
+ * @var array attachment Attachment data
+ * @var string upload_dir Relative path of upload directory
+ * @var int category Attachment category
+ * @var string filename Path to file, including filename
+ * @var int size File size
+ * @since 3.1.11-RC1
+ */
+ $vars = array(
+ 'attachment',
+ 'upload_dir',
+ 'category',
+ 'filename',
+ 'size',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.send_file_to_browser_before', compact($vars)));
+
// To correctly display further errors we need to make sure we are using the correct headers for both (unsetting content-length may not work)
// Check if headers already sent or not able to get the file contents.
diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php
index 227ac3fe0c..8e1a9007e3 100644
--- a/phpBB/includes/functions_user.php
+++ b/phpBB/includes/functions_user.php
@@ -1299,7 +1299,7 @@ function user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reas
*/
function user_unban($mode, $ban)
{
- global $db, $user, $cache, $phpbb_log;
+ global $db, $user, $cache, $phpbb_log, $phpbb_dispatcher;
// Delete stale bans
$sql = 'DELETE FROM ' . BANLIST_TABLE . '
@@ -1373,6 +1373,20 @@ function user_unban($mode, $ban)
));
}
}
+
+ /**
+ * Use this event to perform actions after the unban has been performed
+ *
+ * @event core.user_unban
+ * @var string mode One of the following: user, ip, email
+ * @var array user_ids_ary Array with user_ids
+ * @since 3.1.11-RC1
+ */
+ $vars = array(
+ 'mode',
+ 'user_ids_ary',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.user_unban', compact($vars)));
}
$cache->destroy('sql', BANLIST_TABLE);
diff --git a/phpBB/phpbb/di/proxy_instantiator.php b/phpBB/phpbb/di/proxy_instantiator.php
index a388e82c0e..70295a3dec 100644
--- a/phpBB/phpbb/di/proxy_instantiator.php
+++ b/phpBB/phpbb/di/proxy_instantiator.php
@@ -13,8 +13,6 @@
namespace phpbb\di;
-use bantu\IniGetWrapper\IniGetWrapper;
-use phpbb\filesystem\filesystem;
use ProxyManager\Configuration;
use ProxyManager\Factory\LazyLoadingValueHolderFactory;
use ProxyManager\GeneratorStrategy\EvaluatingGeneratorStrategy;
@@ -45,11 +43,8 @@ class proxy_instantiator implements InstantiatorInterface
// Prevent trying to write to system temp dir in case of open_basedir
// restrictions being in effect
- $ini_wrapper = new IniGetWrapper();
- $filesystem = new filesystem();
$tmp_dir = (function_exists('sys_get_temp_dir')) ? sys_get_temp_dir() : '';
- if (empty($tmp_dir) || $ini_wrapper->getString('open_basedir') &&
- (!$filesystem->exists($tmp_dir) || !$filesystem->is_writable($tmp_dir)))
+ if (empty($tmp_dir) || !@file_exists($tmp_dir) || !@is_writable($tmp_dir))
{
$config->setProxiesTargetDir($cache_dir);
}
diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php
index cdffe69155..0ab29315ee 100644
--- a/phpBB/viewforum.php
+++ b/phpBB/viewforum.php
@@ -786,9 +786,11 @@ $topic_tracking_info = $tracking_topics = array();
* @var array topic_list Array with current viewforum page topic ids
* @var array rowset Array with topics data (in topic_id => topic_data format)
* @var int total_topic_count Forum's total topic count
+* @var int forum_id Forum identifier
* @since 3.1.0-b3
+* @changed 3.1.11-RC1 Added forum_id
*/
-$vars = array('topic_list', 'rowset', 'total_topic_count');
+$vars = array('topic_list', 'rowset', 'total_topic_count', 'forum_id');
extract($phpbb_dispatcher->trigger_event('core.viewforum_modify_topics_data', compact($vars)));
// Okay, lets dump out the page ...