phpBB

Code Changes

File: includes/functions.php

  Unmodified   Added   Modified   Removed
Line 1150Line 1150
function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $user_id = 0)
{
global $db, $user, $config;

function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $user_id = 0)
{
global $db, $user, $config;

	global $request, $phpbb_container;

	global $request, $phpbb_container, $phpbb_dispatcher;


$post_time = ($post_time === 0 || $post_time > time()) ? time() : (int) $post_time;


$post_time = ($post_time === 0 || $post_time > time()) ? time() : (int) $post_time;

 

$should_markread = true;

/**
* This event is used for performing actions directly before marking forums,
* topics or posts as read.
*
* It is also possible to prevent the marking. For that, the $should_markread parameter
* should be set to FALSE.
*
* @event core.markread_before
* @var string mode Variable containing marking mode value
* @var mixed forum_id Variable containing forum id, or false
* @var mixed topic_id Variable containing topic id, or false
* @var int post_time Variable containing post time
* @var int user_id Variable containing the user id
* @var bool should_markread Flag indicating if the markread should be done or not.
* @since 3.1.4-RC1
*/
$vars = array(
'mode',
'forum_id',
'topic_id',
'post_time',
'user_id',
'should_markread',
);
extract($phpbb_dispatcher->trigger_event('core.markread_before', compact($vars)));

if (!$should_markread)
{
return;
}


if ($mode == 'all')
{


if ($mode == 'all')
{

Line 1224Line 1257
		if (!is_array($forum_id))
{
$forum_id = array($forum_id);

		if (!is_array($forum_id))
{
$forum_id = array($forum_id);

 
		}
else
{
$forum_id = array_unique($forum_id);

		}

$phpbb_notifications = $phpbb_container->get('notification_manager');

		}

$phpbb_notifications = $phpbb_container->get('notification_manager');

Line 1648Line 1685
function get_unread_topics($user_id = false, $sql_extra = '', $sql_sort = '', $sql_limit = 1001, $sql_limit_offset = 0)
{
global $config, $db, $user;

function get_unread_topics($user_id = false, $sql_extra = '', $sql_sort = '', $sql_limit = 1001, $sql_limit_offset = 0)
{
global $config, $db, $user;

 
	global $phpbb_dispatcher;


$user_id = ($user_id === false) ? (int) $user->data['user_id'] : (int) $user_id;



$user_id = ($user_id === false) ? (int) $user->data['user_id'] : (int) $user_id;


Line 1690Line 1728
				$sql_extra
$sql_sort",
);

				$sql_extra
$sql_sort",
);

 

/**
* Change SQL query for fetching unread topics data
*
* @event core.get_unread_topics_modify_sql
* @var array sql_array Fully assembled SQL query with keys SELECT, FROM, LEFT_JOIN, WHERE
* @var int last_mark User's last_mark time
* @var string sql_extra Extra WHERE SQL statement
* @var string sql_sort ORDER BY SQL sorting statement
* @since 3.1.4-RC1
*/
$vars = array(
'sql_array',
'last_mark',
'sql_extra',
'sql_sort',
);
extract($phpbb_dispatcher->trigger_event('core.get_unread_topics_modify_sql', compact($vars)));


$sql = $db->sql_build_query('SELECT', $sql_array);
$result = $db->sql_query_limit($sql, $sql_limit, $sql_limit_offset);


$sql = $db->sql_build_query('SELECT', $sql_array);
$result = $db->sql_query_limit($sql, $sql_limit, $sql_limit_offset);

Line 2177Line 2233
	global $config, $user, $request;

$server_name = $user->host;

	global $config, $user, $request;

$server_name = $user->host;

	$server_port = $request->server('SERVER_PORT', 0);

 

// Forcing server vars is the only way to specify/override the protocol
if ($config['force_server_vars'] || !$server_name)


// Forcing server vars is the only way to specify/override the protocol
if ($config['force_server_vars'] || !$server_name)

Line 2192Line 2247
	}
else
{

	}
else
{

 
		$server_port = $request->server('SERVER_PORT', 0);
$forwarded_proto = $request->server('HTTP_X_FORWARDED_PROTO');

if (!empty($forwarded_proto) && $forwarded_proto === 'https')
{
$server_port = 443;
}

		// Do not rely on cookie_secure, users seem to think that it means a secured cookie instead of an encrypted connection
$cookie_secure = $request->is_secure() ? 1 : 0;
$url = (($cookie_secure) ? 'https://' : 'http://') . $server_name;

		// Do not rely on cookie_secure, users seem to think that it means a secured cookie instead of an encrypted connection
$cookie_secure = $request->is_secure() ? 1 : 0;
$url = (($cookie_secure) ? 'https://' : 'http://') . $server_name;

Line 2257Line 2319
		// Attention: only able to redirect within the same domain if $disable_cd_check is false (yourdomain.com -> www.yourdomain.com will not work)
if (!$disable_cd_check && $url_parts['host'] !== $user->host)
{

		// Attention: only able to redirect within the same domain if $disable_cd_check is false (yourdomain.com -> www.yourdomain.com will not work)
if (!$disable_cd_check && $url_parts['host'] !== $user->host)
{

			$url = generate_board_url();

			trigger_error('INSECURE_REDIRECT', E_USER_ERROR);

		}
}
else if ($url[0] == '/')

		}
}
else if ($url[0] == '/')

Line 2295Line 2357
	// Clean URL and check if we go outside the forum directory
$url = $phpbb_path_helper->clean_url($url);


	// Clean URL and check if we go outside the forum directory
$url = $phpbb_path_helper->clean_url($url);


	if (!$disable_cd_check && strpos($url, generate_board_url(true)) === false)

	if (!$disable_cd_check && strpos($url, generate_board_url(true) . '/') !== 0)

	{
trigger_error('INSECURE_REDIRECT', E_USER_ERROR);
}

	{
trigger_error('INSECURE_REDIRECT', E_USER_ERROR);
}

Line 2337Line 2399
	}

// Redirect via an HTML form for PITA webservers

	}

// Redirect via an HTML form for PITA webservers

	if (@preg_match('#Microsoft|WebSTAR|Xitami#', getenv('SERVER_SOFTWARE')))

	if (@preg_match('#WebSTAR|Xitami#', getenv('SERVER_SOFTWARE')))

	{
header('Refresh: 0; URL=' . $url);


	{
header('Refresh: 0; URL=' . $url);


Line 2345Line 2407
		echo '<html dir="' . $user->lang['DIRECTION'] . '" lang="' . $user->lang['USER_LANG'] . '">';
echo '<head>';
echo '<meta charset="utf-8">';

		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 '<meta http-equiv="refresh" content="0; url=' . str_replace('&', '&amp;', $url) . '" />';
echo '<title>' . $user->lang['REDIRECT'] . '</title>';
echo '</head>';

Line 2396Line 2459
{
global $config, $user, $phpbb_path_helper;


{
global $config, $user, $phpbb_path_helper;


	$php_ext = $phpbb_path_helper->get_php_ext();
$page = $user->page['page'];

// We need to be cautious here.
// On some situations, the redirect path is an absolute URL, sometimes a relative path
// For a relative path, let's prefix it with $phpbb_root_path to point to the correct location,
// else we use the URL directly.
$url_parts = parse_url($page);

// URL
if ($url_parts === false || empty($url_parts['scheme']) || empty($url_parts['host']))
{
// Remove 'app.php/' from the page, when rewrite is enabled
if ($config['enable_mod_rewrite'] && strpos($page, 'app.' . $php_ext . '/') === 0)
{
$page = substr($page, strlen('app.' . $php_ext . '/'));
}

$page = $phpbb_path_helper->get_phpbb_root_path() . $page;
}

	$page = $phpbb_path_helper->get_valid_page($user->page['page'], $config['enable_mod_rewrite']);





















// Append SID
$redirect = append_sid($page, false, false);


// Append SID
$redirect = append_sid($page, false, false);

Line 2511Line 2555
{
global $request;


{
global $request;


 
	$version = '';

	if ($request && $request->server('SERVER_PROTOCOL'))
{

	if ($request && $request->server('SERVER_PROTOCOL'))
{

		return $request->server('SERVER_PROTOCOL');

		$version = $request->server('SERVER_PROTOCOL');

	}
else if (isset($_SERVER['SERVER_PROTOCOL']))
{

	}
else if (isset($_SERVER['SERVER_PROTOCOL']))
{

		return $_SERVER['SERVER_PROTOCOL'];






		$version = $_SERVER['SERVER_PROTOCOL'];
}

if (!empty($version) && is_string($version) && preg_match('#^HTTP/[0-9]\.[0-9]$#', $version))
{
return $version;

	}

return 'HTTP/1.0';

	}

return 'HTTP/1.0';

Line 2559Line 2609
/**
* Add a secret token to the form (requires the S_FORM_TOKEN template variable)
* @param string $form_name The name of the form; has to match the name used in check_form_key, otherwise no restrictions apply

/**
* Add a secret token to the form (requires the S_FORM_TOKEN template variable)
* @param string $form_name The name of the form; has to match the name used in check_form_key, otherwise no restrictions apply

 
* @param string  $template_variable_suffix A string that is appended to the name of the template variable to which the form elements are assigned

*/

*/

function add_form_key($form_name)

function add_form_key($form_name, $template_variable_suffix = '')

{
global $config, $template, $user, $phpbb_dispatcher;


{
global $config, $template, $user, $phpbb_dispatcher;


Line 2577Line 2628
	* Perform additional actions on creation of the form token
*
* @event core.add_form_key

	* Perform additional actions on creation of the form token
*
* @event core.add_form_key

	* @var	string	form_name			The form name
* @var int now Current time timestamp
* @var string s_fields Generated hidden fields
* @var string token Form token
* @var string token_sid User session ID


	* @var	string	form_name					The form name
* @var int now Current time timestamp
* @var string s_fields Generated hidden fields
* @var string token Form token
* @var string token_sid User session ID
* @var string template_variable_suffix The string that is appended to template variable name

	*
* @since 3.1.0-RC3

	*
* @since 3.1.0-RC3

 
	* @changed 3.1.11-RC1 Added template_variable_suffix

	*/
$vars = array(
'form_name',

	*/
$vars = array(
'form_name',

Line 2591Line 2644
		's_fields',
'token',
'token_sid',

		's_fields',
'token',
'token_sid',

 
		'template_variable_suffix',

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


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


	$template->assign_vars(array(
'S_FORM_TOKEN' => $s_fields,
));

	$template->assign_var('S_FORM_TOKEN' . $template_variable_suffix, $s_fields);



}

/**

}

/**

Line 2657Line 2709
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 $phpEx, $phpbb_root_path, $request;

	global $config, $phpbb_path_helper;


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


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

Line 2719Line 2771
	}

// re-add sid / transform & to &amp; for user->page (user->page is always using &)

	}

// re-add sid / transform & to &amp; for user->page (user->page is always using &)

	$use_page = ($u_action) ? $phpbb_root_path . $u_action : $phpbb_root_path . str_replace('&', '&amp;', $user->page['page']);
$u_action = reapply_sid($use_page);

	$use_page = ($u_action) ? $u_action : str_replace('&', '&amp;', $user->page['page']);
$u_action = reapply_sid($phpbb_path_helper->get_valid_page($use_page, $config['enable_mod_rewrite']));

	$u_action .= ((strpos($u_action, '?') === false) ? '?' : '&amp;') . 'confirm_key=' . $confirm_key;

$template->assign_vars(array(

	$u_action .= ((strpos($u_action, '?') === false) ? '?' : '&amp;') . 'confirm_key=' . $confirm_key;

$template->assign_vars(array(

		'MESSAGE_TITLE'		=> (!isset($user->lang[$title])) ? $user->lang['CONFIRM'] : $user->lang[$title],

		'MESSAGE_TITLE'		=> (!isset($user->lang[$title])) ? $user->lang['CONFIRM'] : $user->lang($title, 1),

		'MESSAGE_TEXT'		=> (!isset($user->lang[$title . '_CONFIRM'])) ? $title : $user->lang[$title . '_CONFIRM'],

'YES_VALUE' => $user->lang['YES'],

		'MESSAGE_TEXT'		=> (!isset($user->lang[$title . '_CONFIRM'])) ? $title : $user->lang[$title . '_CONFIRM'],

'YES_VALUE' => $user->lang['YES'],

Line 2777Line 2829
	{
$user->setup();
}

	{
$user->setup();
}

 

/**
* This event allows an extension to modify the login process
*
* @event core.login_box_before
* @var string redirect Redirect string
* @var string l_explain Explain language string
* @var string l_success Success language string
* @var bool admin Is admin?
* @var bool s_display Display full login form?
* @var string err Error string
* @since 3.1.9-RC1
*/
$vars = array('redirect', 'l_explain', 'l_success', 'admin', 's_display', 'err');
extract($phpbb_dispatcher->trigger_event('core.login_box_before', compact($vars)));


// Print out error if user tries to authenticate as an administrator without having the privileges...
if ($admin && !$auth->acl_get('a_'))


// Print out error if user tries to authenticate as an administrator without having the privileges...
if ($admin && !$auth->acl_get('a_'))

Line 2790Line 2857
		trigger_error('NO_AUTH_ADMIN');
}


		trigger_error('NO_AUTH_ADMIN');
}


	if ($request->is_set_post('login') || ($request->is_set('login') && $request->variable('login', '') == 'external'))

	if (empty($err) && ($request->is_set_post('login') || ($request->is_set('login') && $request->variable('login', '') == 'external')))

	{
// Get credential
if ($admin)

	{
// Get credential
if ($admin)

Line 2859Line 2926
			*
* @event core.login_box_redirect
* @var string redirect Redirect string

			*
* @event core.login_box_redirect
* @var string redirect Redirect string

			* @var	boolean	admin		Is admin?
* @var bool return If true, do not redirect but return the sanitized URL.

			* @var	bool	admin		Is admin?


			* @since 3.1.0-RC5

			* @since 3.1.0-RC5

 
			* @changed 3.1.9-RC1 Removed undefined return variable

			*/

			*/

			$vars = array('redirect', 'admin', 'return');

			$vars = array('redirect', 'admin');

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

// append/replace SID (may change during the session for AOL users)

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

// append/replace SID (may change during the session for AOL users)

Line 2887Line 2954
		// Special cases... determine
switch ($result['status'])
{

		// Special cases... determine
switch ($result['status'])
{

			case LOGIN_ERROR_ATTEMPTS:

$captcha = $phpbb_container->get('captcha.factory')->get_instance($config['captcha_plugin']);
$captcha->init(CONFIRM_LOGIN);
// $captcha->reset();

$template->assign_vars(array(
'CAPTCHA_TEMPLATE' => $captcha->get_template(),
));

$err = $user->lang[$result['error_msg']];
break;


 
			case LOGIN_ERROR_PASSWORD_CONVERT:
$err = sprintf(
$user->lang[$result['error_msg']],

			case LOGIN_ERROR_PASSWORD_CONVERT:
$err = sprintf(
$user->lang[$result['error_msg']],

Line 2909Line 2963
					'</a>'
);
break;

					'</a>'
);
break;

 

case LOGIN_ERROR_ATTEMPTS:

$captcha = $phpbb_container->get('captcha.factory')->get_instance($config['captcha_plugin']);
$captcha->init(CONFIRM_LOGIN);
// $captcha->reset();

$template->assign_vars(array(
'CAPTCHA_TEMPLATE' => $captcha->get_template(),
));
// no break;


// Username, password, etc...
default:


// Username, password, etc...
default:

Line 2922Line 2987

break;
}


break;
}

 

/**
* This event allows an extension to process when a user fails a login attempt
*
* @event core.login_box_failed
* @var array result Login result data
* @var string username User name used to login
* @var string password Password used to login
* @var string err Error message
* @since 3.1.3-RC1
*/
$vars = array('result', 'username', 'password', 'err');
extract($phpbb_dispatcher->trigger_event('core.login_box_failed', compact($vars)));

	}

// Assign credential for username/password pair

	}

// Assign credential for username/password pair

Line 3301Line 3379
		case 'email':
// Regex written by James Watts and Francisco Jose Martin Moreno
// http://fightingforalostcause.net/misc/2006/compare-email-regex.php

		case 'email':
// Regex written by James Watts and Francisco Jose Martin Moreno
// http://fightingforalostcause.net/misc/2006/compare-email-regex.php

			return '([\w\!\#$\%\&\'\*\+\-\/\=\?\^\`{\|\}\~]+\.)*(?:[\w\!\#$\%\'\*\+\-\/\=\?\^\`{\|\}\~]|&amp;)+@((((([a-z0-9]{1}[a-z0-9\-]{0,62}[a-z0-9]{1})|[a-z])\.)+[a-z]{2,63})|(\d{1,3}\.){3}\d{1,3}(\:\d{1,5})?)';

			return '((?:[\w\!\#$\%\&\'\*\+\-\/\=\?\^\`{\|\}\~]+\.)*(?:[\w\!\#$\%\'\*\+\-\/\=\?\^\`{\|\}\~]|&amp;)+)@((((([a-z0-9]{1}[a-z0-9\-]{0,62}[a-z0-9]{1})|[a-z])\.)+[a-z]{2,63})|(\d{1,3}\.){3}\d{1,3}(\:\d{1,5})?)';

		break;

case 'bbcode_htm':

		break;

case 'bbcode_htm':

Line 3327Line 3405
		break;

case 'url':

		break;

case 'url':

 
			// generated with regex_idn.php file in the develop folder
return "[a-z][a-z\d+\-.]*:/{2}(?:(?:[^\p{C}\p{Z}\p{S}\p{P}\p{Nl}\p{No}\p{Me}\x{1100}-\x{115F}\x{A960}-\x{A97C}\x{1160}-\x{11A7}\x{D7B0}-\x{D7C6}\x{20D0}-\x{20FF}\x{1D100}-\x{1D1FF}\x{1D200}-\x{1D24F}\x{0640}\x{07FA}\x{302E}\x{302F}\x{3031}-\x{3035}\x{303B}]*[\x{00B7}\x{0375}\x{05F3}\x{05F4}\x{30FB}\x{002D}\x{06FD}\x{06FE}\x{0F0B}\x{3007}\x{00DF}\x{03C2}\x{200C}\x{200D}\pL0-9\-._~!$&'()*+,;=:@|]+|%[\dA-F]{2})+|[0-9.]+|\[[a-z0-9.]+:[a-z0-9.]+:[a-z0-9.:]+\])(?::\d*)?(?:/(?:[^\p{C}\p{Z}\p{S}\p{P}\p{Nl}\p{No}\p{Me}\x{1100}-\x{115F}\x{A960}-\x{A97C}\x{1160}-\x{11A7}\x{D7B0}-\x{D7C6}\x{20D0}-\x{20FF}\x{1D100}-\x{1D1FF}\x{1D200}-\x{1D24F}\x{0640}\x{07FA}\x{302E}\x{302F}\x{3031}-\x{3035}\x{303B}]*[\x{00B7}\x{0375}\x{05F3}\x{05F4}\x{30FB}\x{002D}\x{06FD}\x{06FE}\x{0F0B}\x{3007}\x{00DF}\x{03C2}\x{200C}\x{200D}\pL0-9\-._~!$&'()*+,;=:@|]+|%[\dA-F]{2})*)*(?:\?(?:[^\p{C}\p{Z}\p{S}\p{P}\p{Nl}\p{No}\p{Me}\x{1100}-\x{115F}\x{A960}-\x{A97C}\x{1160}-\x{11A7}\x{D7B0}-\x{D7C6}\x{20D0}-\x{20FF}\x{1D100}-\x{1D1FF}\x{1D200}-\x{1D24F}\x{0640}\x{07FA}\x{302E}\x{302F}\x{3031}-\x{3035}\x{303B}]*[\x{00B7}\x{0375}\x{05F3}\x{05F4}\x{30FB}\x{002D}\x{06FD}\x{06FE}\x{0F0B}\x{3007}\x{00DF}\x{03C2}\x{200C}\x{200D}\pL0-9\-._~!$&'()*+,;=:@/?|]+|%[\dA-F]{2})*)?(?:\#(?:[^\p{C}\p{Z}\p{S}\p{P}\p{Nl}\p{No}\p{Me}\x{1100}-\x{115F}\x{A960}-\x{A97C}\x{1160}-\x{11A7}\x{D7B0}-\x{D7C6}\x{20D0}-\x{20FF}\x{1D100}-\x{1D1FF}\x{1D200}-\x{1D24F}\x{0640}\x{07FA}\x{302E}\x{302F}\x{3031}-\x{3035}\x{303B}]*[\x{00B7}\x{0375}\x{05F3}\x{05F4}\x{30FB}\x{002D}\x{06FD}\x{06FE}\x{0F0B}\x{3007}\x{00DF}\x{03C2}\x{200C}\x{200D}\pL0-9\-._~!$&'()*+,;=:@/?|]+|%[\dA-F]{2})*)?";
break;


		case 'url_inline':

		case 'url_inline':

			$inline = ($mode == 'url') ? ')' : '';
$scheme = ($mode == 'url') ? '[a-z\d+\-.]' : '[a-z\d+]'; // avoid automatic parsing of "word" in "last word.http://..."
// generated with regex generation file in the develop folder
return "[a-z]$scheme*:/{2}(?:(?:[a-z0-9\-._~!$&'($inline*+,;=:@|]+|%[\dA-F]{2})+|[0-9.]+|\[[a-z0-9.]+:[a-z0-9.]+:[a-z0-9.:]+\])(?::\d*)?(?:/(?:[a-z0-9\-._~!$&'($inline*+,;=:@|]+|%[\dA-F]{2})*)*(?:\?(?:[a-z0-9\-._~!$&'($inline*+,;=:@/?|]+|%[\dA-F]{2})*)?(?:\#(?:[a-z0-9\-._~!$&'($inline*+,;=:@/?|]+|%[\dA-F]{2})*)?";

			// generated with regex_idn.php file in the develop folder
return "[a-z][a-z\d+]*:/{2}(?:(?:[^\p{C}\p{Z}\p{S}\p{P}\p{Nl}\p{No}\p{Me}\x{1100}-\x{115F}\x{A960}-\x{A97C}\x{1160}-\x{11A7}\x{D7B0}-\x{D7C6}\x{20D0}-\x{20FF}\x{1D100}-\x{1D1FF}\x{1D200}-\x{1D24F}\x{0640}\x{07FA}\x{302E}\x{302F}\x{3031}-\x{3035}\x{303B}]*[\x{00B7}\x{0375}\x{05F3}\x{05F4}\x{30FB}\x{002D}\x{06FD}\x{06FE}\x{0F0B}\x{3007}\x{00DF}\x{03C2}\x{200C}\x{200D}\pL0-9\-._~!$&'(*+,;=:@|]+|%[\dA-F]{2})+|[0-9.]+|\[[a-z0-9.]+:[a-z0-9.]+:[a-z0-9.:]+\])(?::\d*)?(?:/(?:[^\p{C}\p{Z}\p{S}\p{P}\p{Nl}\p{No}\p{Me}\x{1100}-\x{115F}\x{A960}-\x{A97C}\x{1160}-\x{11A7}\x{D7B0}-\x{D7C6}\x{20D0}-\x{20FF}\x{1D100}-\x{1D1FF}\x{1D200}-\x{1D24F}\x{0640}\x{07FA}\x{302E}\x{302F}\x{3031}-\x{3035}\x{303B}]*[\x{00B7}\x{0375}\x{05F3}\x{05F4}\x{30FB}\x{002D}\x{06FD}\x{06FE}\x{0F0B}\x{3007}\x{00DF}\x{03C2}\x{200C}\x{200D}\pL0-9\-._~!$&'(*+,;=:@|]+|%[\dA-F]{2})*)*(?:\?(?:[^\p{C}\p{Z}\p{S}\p{P}\p{Nl}\p{No}\p{Me}\x{1100}-\x{115F}\x{A960}-\x{A97C}\x{1160}-\x{11A7}\x{D7B0}-\x{D7C6}\x{20D0}-\x{20FF}\x{1D100}-\x{1D1FF}\x{1D200}-\x{1D24F}\x{0640}\x{07FA}\x{302E}\x{302F}\x{3031}-\x{3035}\x{303B}]*[\x{00B7}\x{0375}\x{05F3}\x{05F4}\x{30FB}\x{002D}\x{06FD}\x{06FE}\x{0F0B}\x{3007}\x{00DF}\x{03C2}\x{200C}\x{200D}\pL0-9\-._~!$&'(*+,;=:@/?|]+|%[\dA-F]{2})*)?(?:\#(?:[^\p{C}\p{Z}\p{S}\p{P}\p{Nl}\p{No}\p{Me}\x{1100}-\x{115F}\x{A960}-\x{A97C}\x{1160}-\x{11A7}\x{D7B0}-\x{D7C6}\x{20D0}-\x{20FF}\x{1D100}-\x{1D1FF}\x{1D200}-\x{1D24F}\x{0640}\x{07FA}\x{302E}\x{302F}\x{3031}-\x{3035}\x{303B}]*[\x{00B7}\x{0375}\x{05F3}\x{05F4}\x{30FB}\x{002D}\x{06FD}\x{06FE}\x{0F0B}\x{3007}\x{00DF}\x{03C2}\x{200C}\x{200D}\pL0-9\-._~!$&'(*+,;=:@/?|]+|%[\dA-F]{2})*)?";



		break;

case 'www_url':

		break;

case 'www_url':

 
			// generated with regex_idn.php file in the develop folder
return "www\.(?:[^\p{C}\p{Z}\p{S}\p{P}\p{Nl}\p{No}\p{Me}\x{1100}-\x{115F}\x{A960}-\x{A97C}\x{1160}-\x{11A7}\x{D7B0}-\x{D7C6}\x{20D0}-\x{20FF}\x{1D100}-\x{1D1FF}\x{1D200}-\x{1D24F}\x{0640}\x{07FA}\x{302E}\x{302F}\x{3031}-\x{3035}\x{303B}]*[\x{00B7}\x{0375}\x{05F3}\x{05F4}\x{30FB}\x{002D}\x{06FD}\x{06FE}\x{0F0B}\x{3007}\x{00DF}\x{03C2}\x{200C}\x{200D}\pL0-9\-._~!$&'()*+,;=:@|]+|%[\dA-F]{2})+(?::\d*)?(?:/(?:[^\p{C}\p{Z}\p{S}\p{P}\p{Nl}\p{No}\p{Me}\x{1100}-\x{115F}\x{A960}-\x{A97C}\x{1160}-\x{11A7}\x{D7B0}-\x{D7C6}\x{20D0}-\x{20FF}\x{1D100}-\x{1D1FF}\x{1D200}-\x{1D24F}\x{0640}\x{07FA}\x{302E}\x{302F}\x{3031}-\x{3035}\x{303B}]*[\x{00B7}\x{0375}\x{05F3}\x{05F4}\x{30FB}\x{002D}\x{06FD}\x{06FE}\x{0F0B}\x{3007}\x{00DF}\x{03C2}\x{200C}\x{200D}\pL0-9\-._~!$&'()*+,;=:@|]+|%[\dA-F]{2})*)*(?:\?(?:[^\p{C}\p{Z}\p{S}\p{P}\p{Nl}\p{No}\p{Me}\x{1100}-\x{115F}\x{A960}-\x{A97C}\x{1160}-\x{11A7}\x{D7B0}-\x{D7C6}\x{20D0}-\x{20FF}\x{1D100}-\x{1D1FF}\x{1D200}-\x{1D24F}\x{0640}\x{07FA}\x{302E}\x{302F}\x{3031}-\x{3035}\x{303B}]*[\x{00B7}\x{0375}\x{05F3}\x{05F4}\x{30FB}\x{002D}\x{06FD}\x{06FE}\x{0F0B}\x{3007}\x{00DF}\x{03C2}\x{200C}\x{200D}\pL0-9\-._~!$&'()*+,;=:@/?|]+|%[\dA-F]{2})*)?(?:\#(?:[^\p{C}\p{Z}\p{S}\p{P}\p{Nl}\p{No}\p{Me}\x{1100}-\x{115F}\x{A960}-\x{A97C}\x{1160}-\x{11A7}\x{D7B0}-\x{D7C6}\x{20D0}-\x{20FF}\x{1D100}-\x{1D1FF}\x{1D200}-\x{1D24F}\x{0640}\x{07FA}\x{302E}\x{302F}\x{3031}-\x{3035}\x{303B}]*[\x{00B7}\x{0375}\x{05F3}\x{05F4}\x{30FB}\x{002D}\x{06FD}\x{06FE}\x{0F0B}\x{3007}\x{00DF}\x{03C2}\x{200C}\x{200D}\pL0-9\-._~!$&'()*+,;=:@/?|]+|%[\dA-F]{2})*)?";
break;


		case 'www_url_inline':

		case 'www_url_inline':

			$inline = ($mode == 'www_url') ? ')' : '';
return "www\.(?:[a-z0-9\-._~!$&'($inline*+,;=:@|]+|%[\dA-F]{2})+(?::\d*)?(?:/(?:[a-z0-9\-._~!$&'($inline*+,;=:@|]+|%[\dA-F]{2})*)*(?:\?(?:[a-z0-9\-._~!$&'($inline*+,;=:@/?|]+|%[\dA-F]{2})*)?(?:\#(?:[a-z0-9\-._~!$&'($inline*+,;=:@/?|]+|%[\dA-F]{2})*)?";

			// generated with regex_idn.php file in the develop folder
return "www\.(?:[^\p{C}\p{Z}\p{S}\p{P}\p{Nl}\p{No}\p{Me}\x{1100}-\x{115F}\x{A960}-\x{A97C}\x{1160}-\x{11A7}\x{D7B0}-\x{D7C6}\x{20D0}-\x{20FF}\x{1D100}-\x{1D1FF}\x{1D200}-\x{1D24F}\x{0640}\x{07FA}\x{302E}\x{302F}\x{3031}-\x{3035}\x{303B}]*[\x{00B7}\x{0375}\x{05F3}\x{05F4}\x{30FB}\x{002D}\x{06FD}\x{06FE}\x{0F0B}\x{3007}\x{00DF}\x{03C2}\x{200C}\x{200D}\pL0-9\-._~!$&'(*+,;=:@|]+|%[\dA-F]{2})+(?::\d*)?(?:/(?:[^\p{C}\p{Z}\p{S}\p{P}\p{Nl}\p{No}\p{Me}\x{1100}-\x{115F}\x{A960}-\x{A97C}\x{1160}-\x{11A7}\x{D7B0}-\x{D7C6}\x{20D0}-\x{20FF}\x{1D100}-\x{1D1FF}\x{1D200}-\x{1D24F}\x{0640}\x{07FA}\x{302E}\x{302F}\x{3031}-\x{3035}\x{303B}]*[\x{00B7}\x{0375}\x{05F3}\x{05F4}\x{30FB}\x{002D}\x{06FD}\x{06FE}\x{0F0B}\x{3007}\x{00DF}\x{03C2}\x{200C}\x{200D}\pL0-9\-._~!$&'(*+,;=:@|]+|%[\dA-F]{2})*)*(?:\?(?:[^\p{C}\p{Z}\p{S}\p{P}\p{Nl}\p{No}\p{Me}\x{1100}-\x{115F}\x{A960}-\x{A97C}\x{1160}-\x{11A7}\x{D7B0}-\x{D7C6}\x{20D0}-\x{20FF}\x{1D100}-\x{1D1FF}\x{1D200}-\x{1D24F}\x{0640}\x{07FA}\x{302E}\x{302F}\x{3031}-\x{3035}\x{303B}]*[\x{00B7}\x{0375}\x{05F3}\x{05F4}\x{30FB}\x{002D}\x{06FD}\x{06FE}\x{0F0B}\x{3007}\x{00DF}\x{03C2}\x{200C}\x{200D}\pL0-9\-._~!$&'(*+,;=:@/?|]+|%[\dA-F]{2})*)?(?:\#(?:[^\p{C}\p{Z}\p{S}\p{P}\p{Nl}\p{No}\p{Me}\x{1100}-\x{115F}\x{A960}-\x{A97C}\x{1160}-\x{11A7}\x{D7B0}-\x{D7C6}\x{20D0}-\x{20FF}\x{1D100}-\x{1D1FF}\x{1D200}-\x{1D24F}\x{0640}\x{07FA}\x{302E}\x{302F}\x{3031}-\x{3035}\x{303B}]*[\x{00B7}\x{0375}\x{05F3}\x{05F4}\x{30FB}\x{002D}\x{06FD}\x{06FE}\x{0F0B}\x{3007}\x{00DF}\x{03C2}\x{200C}\x{200D}\pL0-9\-._~!$&'(*+,;=:@/?|]+|%[\dA-F]{2})*)?";

		break;

case 'relative_url':

		break;

case 'relative_url':

 
			// generated with regex_idn.php file in the develop folder
return "(?:[^\p{C}\p{Z}\p{S}\p{P}\p{Nl}\p{No}\p{Me}\x{1100}-\x{115F}\x{A960}-\x{A97C}\x{1160}-\x{11A7}\x{D7B0}-\x{D7C6}\x{20D0}-\x{20FF}\x{1D100}-\x{1D1FF}\x{1D200}-\x{1D24F}\x{0640}\x{07FA}\x{302E}\x{302F}\x{3031}-\x{3035}\x{303B}]*[\x{00B7}\x{0375}\x{05F3}\x{05F4}\x{30FB}\x{002D}\x{06FD}\x{06FE}\x{0F0B}\x{3007}\x{00DF}\x{03C2}\x{200C}\x{200D}\pL0-9\-._~!$&'()*+,;=:@|]+|%[\dA-F]{2})*(?:/(?:[^\p{C}\p{Z}\p{S}\p{P}\p{Nl}\p{No}\p{Me}\x{1100}-\x{115F}\x{A960}-\x{A97C}\x{1160}-\x{11A7}\x{D7B0}-\x{D7C6}\x{20D0}-\x{20FF}\x{1D100}-\x{1D1FF}\x{1D200}-\x{1D24F}\x{0640}\x{07FA}\x{302E}\x{302F}\x{3031}-\x{3035}\x{303B}]*[\x{00B7}\x{0375}\x{05F3}\x{05F4}\x{30FB}\x{002D}\x{06FD}\x{06FE}\x{0F0B}\x{3007}\x{00DF}\x{03C2}\x{200C}\x{200D}\pL0-9\-._~!$&'()*+,;=:@|]+|%[\dA-F]{2})*)*(?:\?(?:[^\p{C}\p{Z}\p{S}\p{P}\p{Nl}\p{No}\p{Me}\x{1100}-\x{115F}\x{A960}-\x{A97C}\x{1160}-\x{11A7}\x{D7B0}-\x{D7C6}\x{20D0}-\x{20FF}\x{1D100}-\x{1D1FF}\x{1D200}-\x{1D24F}\x{0640}\x{07FA}\x{302E}\x{302F}\x{3031}-\x{3035}\x{303B}]*[\x{00B7}\x{0375}\x{05F3}\x{05F4}\x{30FB}\x{002D}\x{06FD}\x{06FE}\x{0F0B}\x{3007}\x{00DF}\x{03C2}\x{200C}\x{200D}\pL0-9\-._~!$&'()*+,;=:@/?|]+|%[\dA-F]{2})*)?(?:\#(?:[^\p{C}\p{Z}\p{S}\p{P}\p{Nl}\p{No}\p{Me}\x{1100}-\x{115F}\x{A960}-\x{A97C}\x{1160}-\x{11A7}\x{D7B0}-\x{D7C6}\x{20D0}-\x{20FF}\x{1D100}-\x{1D1FF}\x{1D200}-\x{1D24F}\x{0640}\x{07FA}\x{302E}\x{302F}\x{3031}-\x{3035}\x{303B}]*[\x{00B7}\x{0375}\x{05F3}\x{05F4}\x{30FB}\x{002D}\x{06FD}\x{06FE}\x{0F0B}\x{3007}\x{00DF}\x{03C2}\x{200C}\x{200D}\pL0-9\-._~!$&'()*+,;=:@/?|]+|%[\dA-F]{2})*)?";
break;


		case 'relative_url_inline':

		case 'relative_url_inline':

			$inline = ($mode == 'relative_url') ? ')' : '';
return "(?:[a-z0-9\-._~!$&'($inline*+,;=:@|]+|%[\dA-F]{2})*(?:/(?:[a-z0-9\-._~!$&'($inline*+,;=:@|]+|%[\dA-F]{2})*)*(?:\?(?:[a-z0-9\-._~!$&'($inline*+,;=:@/?|]+|%[\dA-F]{2})*)?(?:\#(?:[a-z0-9\-._~!$&'($inline*+,;=:@/?|]+|%[\dA-F]{2})*)?";

			// generated with regex_idn.php file in the develop folder
return "(?:[^\p{C}\p{Z}\p{S}\p{P}\p{Nl}\p{No}\p{Me}\x{1100}-\x{115F}\x{A960}-\x{A97C}\x{1160}-\x{11A7}\x{D7B0}-\x{D7C6}\x{20D0}-\x{20FF}\x{1D100}-\x{1D1FF}\x{1D200}-\x{1D24F}\x{0640}\x{07FA}\x{302E}\x{302F}\x{3031}-\x{3035}\x{303B}]*[\x{00B7}\x{0375}\x{05F3}\x{05F4}\x{30FB}\x{002D}\x{06FD}\x{06FE}\x{0F0B}\x{3007}\x{00DF}\x{03C2}\x{200C}\x{200D}\pL0-9\-._~!$&'(*+,;=:@|]+|%[\dA-F]{2})*(?:/(?:[^\p{C}\p{Z}\p{S}\p{P}\p{Nl}\p{No}\p{Me}\x{1100}-\x{115F}\x{A960}-\x{A97C}\x{1160}-\x{11A7}\x{D7B0}-\x{D7C6}\x{20D0}-\x{20FF}\x{1D100}-\x{1D1FF}\x{1D200}-\x{1D24F}\x{0640}\x{07FA}\x{302E}\x{302F}\x{3031}-\x{3035}\x{303B}]*[\x{00B7}\x{0375}\x{05F3}\x{05F4}\x{30FB}\x{002D}\x{06FD}\x{06FE}\x{0F0B}\x{3007}\x{00DF}\x{03C2}\x{200C}\x{200D}\pL0-9\-._~!$&'(*+,;=:@|]+|%[\dA-F]{2})*)*(?:\?(?:[^\p{C}\p{Z}\p{S}\p{P}\p{Nl}\p{No}\p{Me}\x{1100}-\x{115F}\x{A960}-\x{A97C}\x{1160}-\x{11A7}\x{D7B0}-\x{D7C6}\x{20D0}-\x{20FF}\x{1D100}-\x{1D1FF}\x{1D200}-\x{1D24F}\x{0640}\x{07FA}\x{302E}\x{302F}\x{3031}-\x{3035}\x{303B}]*[\x{00B7}\x{0375}\x{05F3}\x{05F4}\x{30FB}\x{002D}\x{06FD}\x{06FE}\x{0F0B}\x{3007}\x{00DF}\x{03C2}\x{200C}\x{200D}\pL0-9\-._~!$&'(*+,;=:@/?|]+|%[\dA-F]{2})*)?(?:\#(?:[^\p{C}\p{Z}\p{S}\p{P}\p{Nl}\p{No}\p{Me}\x{1100}-\x{115F}\x{A960}-\x{A97C}\x{1160}-\x{11A7}\x{D7B0}-\x{D7C6}\x{20D0}-\x{20FF}\x{1D100}-\x{1D1FF}\x{1D200}-\x{1D24F}\x{0640}\x{07FA}\x{302E}\x{302F}\x{3031}-\x{3035}\x{303B}]*[\x{00B7}\x{0375}\x{05F3}\x{05F4}\x{30FB}\x{002D}\x{06FD}\x{06FE}\x{0F0B}\x{3007}\x{00DF}\x{03C2}\x{200C}\x{200D}\pL0-9\-._~!$&'(*+,;=:@/?|]+|%[\dA-F]{2})*)?";

		break;

case 'table_prefix':

		break;

case 'table_prefix':

Line 3353Line 3441
		// Matches the predecing dot
case 'path_remove_dot_trailing_slash':
return '#^(?:(\.)?)+(?:(.+)?)+(?:([\\/\\\])$)#';

		// Matches the predecing dot
case 'path_remove_dot_trailing_slash':
return '#^(?:(\.)?)+(?:(.+)?)+(?:([\\/\\\])$)#';

 
		break;

case 'semantic_version':
// Regular expression to match semantic versions by http://rgxdb.com/
return '/(?<=^[Vv]|^)(?:(?<major>(?:0|[1-9](?:(?:0|[1-9])+)*))[.](?<minor>(?:0|[1-9](?:(?:0|[1-9])+)*))[.](?<patch>(?:0|[1-9](?:(?:0|[1-9])+)*))(?:-(?<prerelease>(?:(?:(?:[A-Za-z]|-)(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)?|(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)(?:[A-Za-z]|-)(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)?)|(?:0|[1-9](?:(?:0|[1-9])+)*))(?:[.](?:(?:(?:[A-Za-z]|-)(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)?|(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)(?:[A-Za-z]|-)(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)?)|(?:0|[1-9](?:(?:0|[1-9])+)*)))*))?(?:[+](?<build>(?:(?:(?:[A-Za-z]|-)(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)?|(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)(?:[A-Za-z]|-)(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)?)|(?:(?:0|[1-9])+))(?:[.](?:(?:(?:[A-Za-z]|-)(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)?|(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)(?:[A-Za-z]|-)(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)?)|(?:(?:0|[1-9])+)))*))?)$/';

		break;
}


		break;
}


Line 3918Line 4011
			echo '<html dir="ltr">';
echo '<head>';
echo '<meta charset="utf-8">';

			echo '<html dir="ltr">';
echo '<head>';
echo '<meta charset="utf-8">';

 
			echo '<meta http-equiv="X-UA-Compatible" content="IE=edge">';

			echo '<title>' . $msg_title . '</title>';
echo '<style type="text/css">' . "\n" . '/* <![CDATA[ */' . "\n";
echo '* { margin: 0; padding: 0; } html { font-size: 100%; height: 100%; margin-bottom: 1px; background-color: #E4EDF0; } body { font-family: "Lucida Grande", Verdana, Helvetica, Arial, sans-serif; color: #536482; background: #E4EDF0; font-size: 62.5%; margin: 0; } ';

			echo '<title>' . $msg_title . '</title>';
echo '<style type="text/css">' . "\n" . '/* <![CDATA[ */' . "\n";
echo '* { margin: 0; padding: 0; } html { font-size: 100%; height: 100%; margin-bottom: 1px; background-color: #E4EDF0; } body { font-family: "Lucida Grande", Verdana, Helvetica, Arial, sans-serif; color: #536482; background: #E4EDF0; font-size: 62.5%; margin: 0; } ';

Line 4191Line 4285
*/
function obtain_users_online_string($online_users, $item_id = 0, $item = 'forum')
{

*/
function obtain_users_online_string($online_users, $item_id = 0, $item = 'forum')
{

	global $config, $db, $user, $auth;

	global $config, $db, $user, $auth, $phpbb_dispatcher;





	$user_online_link = $online_userlist = '';


	$guests_online = $hidden_online = $l_online_users = $online_userlist = $visible_online = '';
$user_online_link = $rowset = array();

	// Need caps version of $item for language-strings
$item_caps = strtoupper($item);

if (sizeof($online_users['online_users']))
{

	// Need caps version of $item for language-strings
$item_caps = strtoupper($item);

if (sizeof($online_users['online_users']))
{

		$sql = 'SELECT username, username_clean, user_id, user_type, user_allow_viewonline, user_colour
FROM ' . USERS_TABLE . '
WHERE ' . $db->sql_in_set('user_id', $online_users['online_users']) . '
ORDER BY username_clean ASC';
$result = $db->sql_query($sql);




		$sql_ary = array(
'SELECT' => 'u.username, u.username_clean, u.user_id, u.user_type, u.user_allow_viewonline, u.user_colour',
'FROM' => array(
USERS_TABLE => 'u',
),
'WHERE' => $db->sql_in_set('u.user_id', $online_users['online_users']),
'ORDER_BY' => 'u.username_clean ASC',
);





		while ($row = $db->sql_fetchrow($result))






















		/**
* Modify SQL query to obtain online users data
*
* @event core.obtain_users_online_string_sql
* @var array online_users Array with online users data
* from obtain_users_online()
* @var int item_id Restrict online users to item id
* @var string item Restrict online users to a certain
* session item, e.g. forum for
* session_forum_id
* @var array sql_ary SQL query array to obtain users online data
* @since 3.1.4-RC1
* @changed 3.1.7-RC1 Change sql query into array and adjust var accordingly. Allows extension authors the ability to adjust the sql_ary.
*/
$vars = array('online_users', 'item_id', 'item', 'sql_ary');
extract($phpbb_dispatcher->trigger_event('core.obtain_users_online_string_sql', compact($vars)));

$result = $db->sql_query($db->sql_build_query('SELECT', $sql_ary));
$rowset = $db->sql_fetchrowset($result);
$db->sql_freeresult($result);

foreach ($rowset as $row)

		{
// User is logged in and therefore not a guest
if ($row['user_id'] != ANONYMOUS)

		{
// User is logged in and therefore not a guest
if ($row['user_id'] != ANONYMOUS)

Line 4215Line 4334
					$row['username'] = '<em>' . $row['username'] . '</em>';
}


					$row['username'] = '<em>' . $row['username'] . '</em>';
}


				if (!isset($online_users['hidden_users'][$row['user_id']]) || $auth->acl_get('u_viewonline'))

				if (!isset($online_users['hidden_users'][$row['user_id']]) || $auth->acl_get('u_viewonline') || $row['user_id'] === $user->data['user_id'])

				{

				{

					$user_online_link = get_username_string(($row['user_type'] <> USER_IGNORE) ? 'full' : 'no_profile', $row['user_id'], $row['username'], $row['user_colour']);
$online_userlist .= ($online_userlist != '') ? ', ' . $user_online_link : $user_online_link;

					$user_online_link[$row['user_id']] = get_username_string(($row['user_type'] <> USER_IGNORE) ? 'full' : 'no_profile', $row['user_id'], $row['username'], $row['user_colour']);


				}
}
}

				}
}
}

		$db->sql_freeresult($result);

 
	}

	}

 

/**
* Modify online userlist data
*
* @event core.obtain_users_online_string_before_modify
* @var array online_users Array with online users data
* from obtain_users_online()
* @var int item_id Restrict online users to item id
* @var string item Restrict online users to a certain
* session item, e.g. forum for
* session_forum_id
* @var array rowset Array with online users data
* @var array user_online_link Array with online users items (usernames)
* @since 3.1.10-RC1
*/
$vars = array(
'online_users',
'item_id',
'item',
'rowset',
'user_online_link',
);
extract($phpbb_dispatcher->trigger_event('core.obtain_users_online_string_before_modify', compact($vars)));

$online_userlist = implode(', ', $user_online_link);


if (!$online_userlist)
{


if (!$online_userlist)
{

Line 4255Line 4397
	{
$l_online_users = $user->lang('ONLINE_USERS_TOTAL', (int) $online_users['total_online'], $visible_online, $hidden_online);
}

	{
$l_online_users = $user->lang('ONLINE_USERS_TOTAL', (int) $online_users['total_online'], $visible_online, $hidden_online);
}

 

/**
* Modify online userlist data
*
* @event core.obtain_users_online_string_modify
* @var array online_users Array with online users data
* from obtain_users_online()
* @var int item_id Restrict online users to item id
* @var string item Restrict online users to a certain
* session item, e.g. forum for
* session_forum_id
* @var array rowset Array with online users data
* @var array user_online_link Array with online users items (usernames)
* @var string online_userlist String containing users online list
* @var string l_online_users String with total online users count info
* @since 3.1.4-RC1
*/
$vars = array(
'online_users',
'item_id',
'item',
'rowset',
'user_online_link',
'online_userlist',
'l_online_users',
);
extract($phpbb_dispatcher->trigger_event('core.obtain_users_online_string_modify', compact($vars)));


return array(
'online_userlist' => $online_userlist,


return array(
'online_userlist' => $online_userlist,

Line 4673Line 4842
* @param array $user_row Row from the users table
* @param string $alt Optional language string for alt tag within image, can be a language key or text
* @param bool $ignore_config Ignores the config-setting, to be still able to view the avatar in the UCP

* @param array $user_row Row from the users table
* @param string $alt Optional language string for alt tag within image, can be a language key or text
* @param bool $ignore_config Ignores the config-setting, to be still able to view the avatar in the UCP

 
* @param bool $lazy If true, will be lazy loaded (requires JS)

*
* @return string Avatar html
*/

*
* @return string Avatar html
*/

function phpbb_get_user_avatar($user_row, $alt = 'USER_AVATAR', $ignore_config = false)

function phpbb_get_user_avatar($user_row, $alt = 'USER_AVATAR', $ignore_config = false, $lazy = false)

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

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

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

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

}

/**

}

/**

Line 4688Line 4858
* @param array $group_row Row from the groups table
* @param string $alt Optional language string for alt tag within image, can be a language key or text
* @param bool $ignore_config Ignores the config-setting, to be still able to view the avatar in the UCP

* @param array $group_row Row from the groups table
* @param string $alt Optional language string for alt tag within image, can be a language key or text
* @param bool $ignore_config Ignores the config-setting, to be still able to view the avatar in the UCP

 
* @param bool $lazy If true, will be lazy loaded (requires JS)

*
* @return string Avatar html
*/

*
* @return string Avatar html
*/

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

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

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

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

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

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

}

/**

}

/**

Line 4703Line 4874
* @param array $row Row cleaned by \phpbb\avatar\manager::clean_row
* @param string $alt Optional language string for alt tag within image, can be a language key or text
* @param bool $ignore_config Ignores the config-setting, to be still able to view the avatar in the UCP

* @param array $row Row cleaned by \phpbb\avatar\manager::clean_row
* @param string $alt Optional language string for alt tag within image, can be a language key or text
* @param bool $ignore_config Ignores the config-setting, to be still able to view the avatar in the UCP

 
* @param bool $lazy If true, will be lazy loaded (requires JS)

*
* @return string Avatar html
*/

*
* @return string Avatar html
*/

function phpbb_get_avatar($row, $alt, $ignore_config = false)

function phpbb_get_avatar($row, $alt, $ignore_config = false, $lazy = false)

{
global $user, $config, $cache, $phpbb_root_path, $phpEx;
global $request;

{
global $user, $config, $cache, $phpbb_root_path, $phpEx;
global $request;

	global $phpbb_container;

	global $phpbb_container, $phpbb_dispatcher;


if (!$config['allow_avatar'] && !$ignore_config)
{


if (!$config['allow_avatar'] && !$ignore_config)
{

Line 4724Line 4896
	);

$phpbb_avatar_manager = $phpbb_container->get('avatar.manager');

	);

$phpbb_avatar_manager = $phpbb_container->get('avatar.manager');

	$driver = $phpbb_avatar_manager->get_driver($row['avatar_type'], $ignore_config);

	$driver = $phpbb_avatar_manager->get_driver($row['avatar_type'], !$ignore_config);

	$html = '';

if ($driver)

	$html = '';

if ($driver)

Line 4735Line 4907
			return $html;
}


			return $html;
}


		$avatar_data = $driver->get_data($row, $ignore_config);

		$avatar_data = $driver->get_data($row);

	}
else
{

	}
else
{

Line 4744Line 4916

if (!empty($avatar_data['src']))
{


if (!empty($avatar_data['src']))
{

		$html = '<img src="' . $avatar_data['src'] . '" ' .






















		if ($lazy)
{
// Determine board url - we may need it later
$board_url = generate_board_url() . '/';
// 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_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;

$theme = "{$web_path}styles/" . rawurlencode($user->style['style_path']) . '/theme';

$src = 'src="' . $theme . '/images/no_avatar.gif" data-src="' . $avatar_data['src'] . '"';
}
else
{
$src = 'src="' . $avatar_data['src'] . '"';
}

$html = '<img class="avatar" ' . $src . ' ' .

			($avatar_data['width'] ? ('width="' . $avatar_data['width'] . '" ') : '') .
($avatar_data['height'] ? ('height="' . $avatar_data['height'] . '" ') : '') .
'alt="' . ((!empty($user->lang[$alt])) ? $user->lang[$alt] : $alt) . '" />';
}

			($avatar_data['width'] ? ('width="' . $avatar_data['width'] . '" ') : '') .
($avatar_data['height'] ? ('height="' . $avatar_data['height'] . '" ') : '') .
'alt="' . ((!empty($user->lang[$alt])) ? $user->lang[$alt] : $alt) . '" />';
}

 

/**
* Event to modify HTML <img> tag of avatar
*
* @event core.get_avatar_after
* @var array row Row cleaned by \phpbb\avatar\manager::clean_row
* @var string alt Optional language string for alt tag within image, can be a language key or text
* @var bool ignore_config Ignores the config-setting, to be still able to view the avatar in the UCP
* @var array avatar_data The HTML attributes for avatar <img> tag
* @var string html The HTML <img> tag of generated avatar
* @since 3.1.6-RC1
*/
$vars = array('row', 'alt', 'ignore_config', 'avatar_data', 'html');
extract($phpbb_dispatcher->trigger_event('core.get_avatar_after', compact($vars)));


return $html;
}


return $html;
}

Line 4756Line 4963
/**
* Generate page header
*/

/**
* Generate page header
*/

function page_header($page_title = '', $display_online_list = false, $item_id = 0, $item = 'forum')

function page_header($page_title = '', $display_online_list = false, $item_id = 0, $item = 'forum', $send_headers = true)

{
global $db, $config, $template, $SID, $_SID, $_EXTRA_URL, $user, $auth, $phpEx, $phpbb_root_path;
global $phpbb_dispatcher, $request, $phpbb_container, $phpbb_admin_path;

{
global $db, $config, $template, $SID, $_SID, $_EXTRA_URL, $user, $auth, $phpEx, $phpbb_root_path;
global $phpbb_dispatcher, $request, $phpbb_container, $phpbb_admin_path;

Line 4815Line 5022
			ob_start('ob_gzhandler');
}
}

			ob_start('ob_gzhandler');
}
}

 

$user->update_session_infos();


// Generate logged in/logged out status
if ($user->data['user_id'] != ANONYMOUS)


// Generate logged in/logged out status
if ($user->data['user_id'] != ANONYMOUS)

Line 5094Line 5303
		'SITE_LOGO_IMG'			=> $user->img('site_logo'),
));


		'SITE_LOGO_IMG'			=> $user->img('site_logo'),
));


 
	$http_headers = array();

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(

		$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"',

		// application/xhtml+xml not used because of IE
'Content-type' => 'text/html; charset=UTF-8',
'Cache-Control' => 'private, no-cache="set-cookie"',

Line 5105Line 5318
	{
// Let reverse proxies know we detected a bot.
$http_headers['X-PHPBB-IS-BOT'] = 'yes';

	{
// Let reverse proxies know we detected a bot.
$http_headers['X-PHPBB-IS-BOT'] = 'yes';

 
		}

	}

/**

	}

/**