phpBB

Code Changes

File: includes/functions.php

  Unmodified   Added   Modified   Removed
Line 1841Line 1841
	else
{
garbage_collection();

	else
{
garbage_collection();

	}

// Redirect via an HTML form for PITA webservers
if (@preg_match('#WebSTAR|Xitami#', getenv('SERVER_SOFTWARE')))
{
header('Refresh: 0; URL=' . $url);

echo '<!DOCTYPE html>';
echo '<html dir="' . $user->lang['DIRECTION'] . '" lang="' . $user->lang['USER_LANG'] . '">';
echo '<head>';
echo '<meta charset="utf-8">';
echo '<meta http-equiv="X-UA-Compatible" content="IE=edge">';
echo '<meta http-equiv="refresh" content="0; url=' . str_replace('&', '&amp;', $url) . '" />';
echo '<title>' . $user->lang['REDIRECT'] . '</title>';
echo '</head>';
echo '<body>';
echo '<div style="text-align: center;">' . sprintf($user->lang['URL_REDIRECT'], '<a href="' . str_replace('&', '&amp;', $url) . '">', '</a>') . '</div>';
echo '</body>';
echo '</html>';

exit;

 
	}

// Behave as per HTTP/1.1 spec for others

	}

// Behave as per HTTP/1.1 spec for others

Line 2158Line 2137
function confirm_box($check, $title = '', $hidden = '', $html_body = 'confirm_body.html', $u_action = '')
{
global $user, $template, $db, $request;

function confirm_box($check, $title = '', $hidden = '', $html_body = 'confirm_body.html', $u_action = '')
{
global $user, $template, $db, $request;

	global $config, $language, $phpbb_path_helper;

	global $config, $language, $phpbb_path_helper, $phpbb_dispatcher;


if (isset($_POST['cancel']))
{


if (isset($_POST['cancel']))
{

Line 2255Line 2234
	if ($request->is_ajax())
{
$u_action .= '&confirm_uid=' . $user->data['user_id'] . '&sess=' . $user->session_id . '&sid=' . $user->session_id;

	if ($request->is_ajax())
{
$u_action .= '&confirm_uid=' . $user->data['user_id'] . '&sess=' . $user->session_id . '&sid=' . $user->session_id;

		$json_response = new \phpbb\json_response;
$json_response->send(array(

		$data = array(


			'MESSAGE_BODY'		=> $template->assign_display('body'),
'MESSAGE_TITLE' => $confirm_title,
'MESSAGE_TEXT' => $confirm_text,

			'MESSAGE_BODY'		=> $template->assign_display('body'),
'MESSAGE_TITLE' => $confirm_title,
'MESSAGE_TEXT' => $confirm_text,

Line 2264Line 2242
			'YES_VALUE'			=> $language->lang('YES'),
'S_CONFIRM_ACTION' => str_replace('&amp;', '&', $u_action), //inefficient, rewrite whole function
'S_HIDDEN_FIELDS' => $hidden . $s_hidden_fields

			'YES_VALUE'			=> $language->lang('YES'),
'S_CONFIRM_ACTION' => str_replace('&amp;', '&', $u_action), //inefficient, rewrite whole function
'S_HIDDEN_FIELDS' => $hidden . $s_hidden_fields

		));






















		);

/**
* This event allows an extension to modify the ajax output of confirm box.
*
* @event core.confirm_box_ajax_before
* @var string u_action Action of the form
* @var array data Data to be sent
* @var string hidden Hidden fields generated by caller
* @var string s_hidden_fields Hidden fields generated by this function
* @since 3.2.8-RC1
*/
$vars = array(
'u_action',
'data',
'hidden',
's_hidden_fields',
);
extract($phpbb_dispatcher->trigger_event('core.confirm_box_ajax_before', compact($vars)));

$json_response = new \phpbb\json_response;
$json_response->send($data);

	}

if (defined('IN_ADMIN') && isset($user->data['session_admin']) && $user->data['session_admin'])

	}

if (defined('IN_ADMIN') && isset($user->data['session_admin']) && $user->data['session_admin'])

Line 2365Line 2364
		}

// Check form key

		}

// Check form key

		if ($password && !check_form_key($form_name))

		if ($password && !defined('IN_CHECK_BAN') && !check_form_key($form_name))

		{
$result = array(
'status' => false,

		{
$result = array(
'status' => false,

Line 2526Line 2525
			'PROVIDER_TEMPLATE_FILE' => $auth_provider_data['TEMPLATE_FILE'],
));
}

			'PROVIDER_TEMPLATE_FILE' => $auth_provider_data['TEMPLATE_FILE'],
));
}


// Add form token for login box
add_form_key($form_name, '_LOGIN');

 

$s_hidden_fields = build_hidden_fields($s_hidden_fields);



$s_hidden_fields = build_hidden_fields($s_hidden_fields);


Line 2663Line 2659
	extract($phpbb_dispatcher->trigger_event('core.login_forum_box', compact($vars)));

page_header($user->lang['LOGIN']);

	extract($phpbb_dispatcher->trigger_event('core.login_forum_box', compact($vars)));

page_header($user->lang['LOGIN']);


// Add form token for login box
add_form_key('login', '_LOGIN');

 

$template->assign_vars(array(
'FORUM_NAME' => isset($forum_data['forum_name']) ? $forum_data['forum_name'] : '',


$template->assign_vars(array(
'FORUM_NAME' => isset($forum_data['forum_name']) ? $forum_data['forum_name'] : '',

Line 4132Line 4125
*
* @return string Avatar html
*/

*
* @return string Avatar html
*/

function phpbb_get_group_avatar($user_row, $alt = 'GROUP_AVATAR', $ignore_config = false, $lazy = false)

function phpbb_get_group_avatar($group_row, $alt = 'GROUP_AVATAR', $ignore_config = false, $lazy = false)

{

{

	$row = \phpbb\avatar\manager::clean_row($user_row, 'group');

	$row = \phpbb\avatar\manager::clean_row($group_row, 'group');

	return phpbb_get_avatar($row, $alt, $ignore_config, $lazy);
}


	return phpbb_get_avatar($row, $alt, $ignore_config, $lazy);
}


Line 4440Line 4433
	$notification_mark_hash = generate_link_hash('mark_all_notifications_read');

$s_login_redirect = build_hidden_fields(array('redirect' => $phpbb_path_helper->remove_web_root_path(build_url())));

	$notification_mark_hash = generate_link_hash('mark_all_notifications_read');

$s_login_redirect = build_hidden_fields(array('redirect' => $phpbb_path_helper->remove_web_root_path(build_url())));

 

// Add form token for login box, in case page is presenting a login form.
add_form_key('login', '_LOGIN');


	/**
* Workaround for missing template variable in pre phpBB 3.2.6 styles.
* @deprecated 3.2.7 (To be removed: 3.3.0-a1)

	/**
* Workaround for missing template variable in pre phpBB 3.2.6 styles.
* @deprecated 3.2.7 (To be removed: 3.3.0-a1)

Line 4592Line 4589

if ($send_headers)
{


if ($send_headers)
{

		// An array of http headers that phpbb will set. The following event may override these.

		// An array of http headers that phpBB will set. The following event may override these.

		$http_headers += array(
// application/xhtml+xml not used because of IE
'Content-type' => 'text/html; charset=UTF-8',
'Cache-Control' => 'private, no-cache="set-cookie"',
'Expires' => gmdate('D, d M Y H:i:s', time()) . ' GMT',

		$http_headers += array(
// application/xhtml+xml not used because of IE
'Content-type' => 'text/html; charset=UTF-8',
'Cache-Control' => 'private, no-cache="set-cookie"',
'Expires' => gmdate('D, d M Y H:i:s', time()) . ' GMT',

 
			'Referrer-Policy' => 'strict-origin-when-cross-origin',

		);
if (!empty($user->data['is_bot']))
{

		);
if (!empty($user->data['is_bot']))
{