1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-06 00:37:42 +02:00

Merge branch 'develop' of https://github.com/phpbb/phpbb3 into feature/passwords

Conflicts:
	phpBB/includes/functions.php
This commit is contained in:
Marc Alexander
2013-10-03 10:04:59 +02:00
38 changed files with 388 additions and 337 deletions

View File

@@ -126,13 +126,13 @@ class bbcode
*/
function bbcode_cache_init()
{
global $phpbb_root_path, $phpEx, $config, $user, $phpbb_extension_manager, $phpbb_filesystem;
global $phpbb_root_path, $phpEx, $config, $user, $phpbb_extension_manager, $phpbb_path_helper;
if (empty($this->template_filename))
{
$this->template_bitfield = new bitfield($user->style['bbcode_bitfield']);
$template = new phpbb\template\twig\twig($phpbb_filesystem, $config, $user, new phpbb\template\context(), $phpbb_extension_manager);
$template = new phpbb\template\twig\twig($phpbb_path_helper, $config, $user, new phpbb\template\context(), $phpbb_extension_manager);
$template->set_style();
$template->set_filenames(array('bbcode.html' => 'bbcode.html'));
$this->template_filename = $template->get_source_file_for_handle('bbcode.html');

View File

@@ -1025,31 +1025,32 @@ else
*/
function phpbb_clean_path($path)
{
global $phpbb_container;
global $phpbb_path_helper, $phpbb_container;
if ($phpbb_container)
if (!$phpbb_path_helper && $phpbb_container)
{
$phpbb_filesystem = $phpbb_container->get('filesystem');
$phpbb_path_helper = $phpbb_container->get('path_helper');
}
else
else if (!$phpbb_path_helper)
{
// The container is not yet loaded, use a new instance
if (!class_exists('\phpbb\filesystem'))
if (!class_exists('\phpbb\path_helper'))
{
global $phpbb_root_path, $phpEx;
require($phpbb_root_path . 'includes/filesystem.' . $phpEx);
require($phpbb_root_path . 'phpbb/path_helper.' . $phpEx);
}
$phpbb_filesystem = new phpbb\filesystem(
$phpbb_path_helper = new phpbb\path_helper(
new phpbb\symfony_request(
new phpbb\request\request()
),
new phpbb\filesystem(),
$phpbb_root_path,
$phpEx
);
}
return $phpbb_filesystem->clean_path($path);
return $phpbb_path_helper->clean_path($path);
}
// functions used for building option fields
@@ -2414,7 +2415,7 @@ function phpbb_on_page($template, $user, $base_url, $num_items, $per_page, $star
*/
function append_sid($url, $params = false, $is_amp = true, $session_id = false)
{
global $_SID, $_EXTRA_URL, $phpbb_hook, $phpbb_filesystem;
global $_SID, $_EXTRA_URL, $phpbb_hook, $phpbb_path_helper;
global $phpbb_dispatcher;
if ($params === '' || (is_array($params) && empty($params)))
@@ -2424,9 +2425,9 @@ function append_sid($url, $params = false, $is_amp = true, $session_id = false)
}
// Update the root path with the correct relative web path
if ($phpbb_filesystem instanceof \phpbb\filesystem)
if ($phpbb_path_helper instanceof \phpbb\path_helper)
{
$url = $phpbb_filesystem->update_web_root_path($url);
$url = $phpbb_path_helper->update_web_root_path($url);
}
$append_sid_overwrite = false;
@@ -5245,8 +5246,8 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0
// This path is sent with the base template paths in the assign_vars()
// call below. We need to correct it in case we are accessing from a
// controller because the web paths will be incorrect otherwise.
$phpbb_filesystem = $phpbb_container->get('filesystem');
$corrected_path = $phpbb_filesystem->get_web_root_path();
$phpbb_path_helper = $phpbb_container->get('path_helper');
$corrected_path = $phpbb_path_helper->get_web_root_path();
$web_path = (defined('PHPBB_USE_BOARD_URL_PATH') && PHPBB_USE_BOARD_URL_PATH) ? $board_url : $corrected_path;
// Send a proper content-language to the output

View File

@@ -834,7 +834,7 @@ function bbcode_nl2br($text)
*/
function smiley_text($text, $force_option = false)
{
global $config, $user, $phpbb_filesystem;
global $config, $user, $phpbb_path_helper;
if ($force_option || !$config['allow_smilies'] || !$user->optionget('viewsmilies'))
{
@@ -842,7 +842,7 @@ function smiley_text($text, $force_option = false)
}
else
{
$root_path = (defined('PHPBB_USE_BOARD_URL_PATH') && PHPBB_USE_BOARD_URL_PATH) ? generate_board_url() . '/' : $phpbb_filesystem->get_web_root_path();
$root_path = (defined('PHPBB_USE_BOARD_URL_PATH') && PHPBB_USE_BOARD_URL_PATH) ? generate_board_url() . '/' : $phpbb_path_helper->get_web_root_path();
return preg_replace('#<!\-\- s(.*?) \-\-><img src="\{SMILIES_PATH\}\/(.*?) \/><!\-\- s\1 \-\->#', '<img class="smilies" src="' . $root_path . $config['smilies_path'] . '/\2 />', $text);
}
}

View File

@@ -626,14 +626,14 @@ class messenger
*/
protected function setup_template()
{
global $config, $phpbb_filesystem, $user, $phpbb_extension_manager;
global $config, $phpbb_path_helper, $user, $phpbb_extension_manager;
if ($this->template instanceof \phpbb\template\template)
{
return;
}
$this->template = new \phpbb\template\twig\twig($phpbb_filesystem, $config, $user, new \phpbb\template\context(), $phpbb_extension_manager);
$this->template = new \phpbb\template\twig\twig($phpbb_path_helper, $config, $user, new \phpbb\template\context(), $phpbb_extension_manager);
}
/**

View File

@@ -388,12 +388,13 @@ function user_delete($mode, $user_ids, $retain_username = true)
* Event before a user is deleted
*
* @event core.delete_user_before
* @var string mode Mode of deletion (retain/delete posts)
* @var int user_id ID of the deleted user
* @var mixed post_username Guest username that is being used or false
* @var string mode Mode of deletion (retain/delete posts)
* @var array user_ids IDs of the deleted user
* @var mixed retain_username True if username should be retained
* or false if not
* @since 3.1-A1
*/
$vars = array('mode', 'user_id', 'post_username');
$vars = array('mode', 'user_ids', 'retain_username');
extract($phpbb_dispatcher->trigger_event('core.delete_user_before', compact($vars)));
// Before we begin, we will remove the reports the user issued.
@@ -616,12 +617,13 @@ function user_delete($mode, $user_ids, $retain_username = true)
* Event after a user is deleted
*
* @event core.delete_user_after
* @var string mode Mode of deletion (retain/delete posts)
* @var int user_id ID of the deleted user
* @var mixed post_username Guest username that is being used or false
* @var string mode Mode of deletion (retain/delete posts)
* @var array user_ids IDs of the deleted user
* @var mixed retain_username True if username should be retained
* or false if not
* @since 3.1-A1
*/
$vars = array('mode', 'user_id', 'post_username');
$vars = array('mode', 'user_ids', 'retain_username');
extract($phpbb_dispatcher->trigger_event('core.delete_user_after', compact($vars)));
// Reset newest user info if appropriate