phpBB

Code Changes

File: includes/functions.php

  Unmodified   Added   Modified   Removed
Line 20Line 20
}

// Common global functions

}

// Common global functions

/**
* Load the autoloaders added by the extensions.
*
* @param string $phpbb_root_path Path to the phpbb root directory.
*/
function phpbb_load_extensions_autoloaders($phpbb_root_path)
{
$iterator = new \RecursiveIteratorIterator(
new \phpbb\recursive_dot_prefix_filter_iterator(
new \RecursiveDirectoryIterator(
$phpbb_root_path . 'ext/',
\FilesystemIterator::SKIP_DOTS | \FilesystemIterator::FOLLOW_SYMLINKS
)
),
\RecursiveIteratorIterator::SELF_FIRST
);
$iterator->setMaxDepth(2);

foreach ($iterator as $file_info)
{
if ($file_info->getFilename() === 'vendor' && $iterator->getDepth() === 2)
{
$filename = $file_info->getRealPath() . '/autoload.php';
if (file_exists($filename))
{
require $filename;
}
}
}
}


 
/**
* Generates an alphanumeric random string of given length
*

/**
* Generates an alphanumeric random string of given length
*

Line 138Line 107
	}

// getdate() interprets timestamps in local time.

	}

// getdate() interprets timestamps in local time.

	// What follows uses the fact that getdate() and
// date('Z') balance each other out.
return getdate($time - date('Z'));









	// So use UTC timezone temporarily to get UTC date info array.
$current_timezone = date_default_timezone_get();

// Set UTC timezone and get respective date info
date_default_timezone_set('UTC');
$date_info = getdate($time);

// Restore timezone back
date_default_timezone_set($current_timezone);

return $date_info;

}

/**

}

/**

Line 261Line 238
	}

return (ceil($current_time - $start_time) < $max_execution_time) ? true : false;

	}

return (ceil($current_time - $start_time) < $max_execution_time) ? true : false;

}

/**
* Hashes an email address to a big integer
*
* @param string $email Email address
*
* @return string Unsigned Big Integer
*/
function phpbb_email_hash($email)
{
return sprintf('%u', crc32(strtolower($email))) . strlen($email);

 
}

/**

}

/**

Line 307Line 272

/**
* Pick a language, any language ...


/**
* Pick a language, any language ...

 
 *
* @param string $default Language ISO code to be selected by default in the dropdown list
* @param array $langdata Language data in format of array(array('lang_iso' => string, lang_local_name => string), ...)
*
* @return string HTML options for language selection dropdown list.

*/

*/

function language_select($default = '')

function language_select($default = '', array $langdata = [])

{
global $db;


{
global $db;


 
	if (empty($langdata))
{

	$sql = 'SELECT lang_iso, lang_local_name
FROM ' . LANG_TABLE . '
ORDER BY lang_english_name';
$result = $db->sql_query($sql);

	$sql = 'SELECT lang_iso, lang_local_name
FROM ' . LANG_TABLE . '
ORDER BY lang_english_name';
$result = $db->sql_query($sql);

 
		$langdata = (array) $db->sql_fetchrowset($result);
$db->sql_freeresult($result);
}


$lang_options = '';


$lang_options = '';

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

	foreach ($langdata as $row)

	{
$selected = ($row['lang_iso'] == $default) ? ' selected="selected"' : '';
$lang_options .= '<option value="' . $row['lang_iso'] . '"' . $selected . '>' . $row['lang_local_name'] . '</option>';
}

	{
$selected = ($row['lang_iso'] == $default) ? ' selected="selected"' : '';
$lang_options .= '<option value="' . $row['lang_iso'] . '"' . $selected . '>' . $row['lang_local_name'] . '</option>';
}

	$db->sql_freeresult($result);

 

return $lang_options;
}

/**


return $lang_options;
}

/**

* Pick a template/theme combo,







 * Pick a template/theme combo
*
* @param string $default Style ID to be selected by default in the dropdown list
* @param bool $all Flag indicating if all styles data including inactive ones should be fetched
* @param array $styledata Style data in format of array(array('style_id' => int, style_name => string), ...)
*
* @return string HTML options for style selection dropdown list.

*/

*/

function style_select($default = '', $all = false)

function style_select($default = '', $all = false, array $styledata = [])

{
global $db;


{
global $db;


 
	if (empty($styledata))
{

	$sql_where = (!$all) ? 'WHERE style_active = 1 ' : '';
$sql = 'SELECT style_id, style_name
FROM ' . STYLES_TABLE . "
$sql_where
ORDER BY style_name";
$result = $db->sql_query($sql);

	$sql_where = (!$all) ? 'WHERE style_active = 1 ' : '';
$sql = 'SELECT style_id, style_name
FROM ' . STYLES_TABLE . "
$sql_where
ORDER BY style_name";
$result = $db->sql_query($sql);

 
		$styledata = (array) $db->sql_fetchrowset($result);
$db->sql_freeresult($result);
}


$style_options = '';


$style_options = '';

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

	foreach ($styledata as $row)

	{
$selected = ($row['style_id'] == $default) ? ' selected="selected"' : '';
$style_options .= '<option value="' . $row['style_id'] . '"' . $selected . '>' . $row['style_name'] . '</option>';
}

	{
$selected = ($row['style_id'] == $default) ? ' selected="selected"' : '';
$style_options .= '<option value="' . $row['style_id'] . '"' . $selected . '>' . $row['style_name'] . '</option>';
}

	$db->sql_freeresult($result);

 

return $style_options;
}


return $style_options;
}

Line 623Line 607
				'notification.type.post',
'notification.type.approve_topic',
'notification.type.approve_post',

				'notification.type.post',
'notification.type.approve_topic',
'notification.type.approve_post',

 
				'notification.type.forum',

			), false, $user->data['user_id'], $post_time);

if ($config['load_db_lastread'] && $user->data['is_registered'])

			), false, $user->data['user_id'], $post_time);

if ($config['load_db_lastread'] && $user->data['is_registered'])

Line 706Line 691
			'notification.type.bookmark',
'notification.type.post',
'notification.type.approve_post',

			'notification.type.bookmark',
'notification.type.post',
'notification.type.approve_post',

 
			'notification.type.forum',

		), $topic_ids, $user->data['user_id'], $post_time);

// Add 0 to forums array to mark global announcements correctly

		), $topic_ids, $user->data['user_id'], $post_time);

// Add 0 to forums array to mark global announcements correctly

Line 816Line 802
			'notification.type.bookmark',
'notification.type.post',
'notification.type.approve_post',

			'notification.type.bookmark',
'notification.type.post',
'notification.type.approve_post',

 
			'notification.type.forum',

		), $topic_id, $user->data['user_id'], $post_time);

if ($config['load_db_lastread'] && $user->data['is_registered'])

		), $topic_id, $user->data['user_id'], $post_time);

if ($config['load_db_lastread'] && $user->data['is_registered'])

Line 1115Line 1102
* @param string $sql_limit		Limits the size of unread topics list, 0 for unlimited query
* @param string $sql_limit_offset Sets the offset of the first row to search, 0 to search from the start
*

* @param string $sql_limit		Limits the size of unread topics list, 0 for unlimited query
* @param string $sql_limit_offset Sets the offset of the first row to search, 0 to search from the start
*

* @return array[int][int]		Topic ids as keys, mark_time of topic as value

* @return int[]		Topic ids as keys, mark_time of topic as value

*/
function get_unread_topics($user_id = false, $sql_extra = '', $sql_sort = '', $sql_limit = 1001, $sql_limit_offset = 0)
{

*/
function get_unread_topics($user_id = false, $sql_extra = '', $sql_sort = '', $sql_limit = 1001, $sql_limit_offset = 0)
{

Line 1504Line 1491
* @return string The corrected url.
*
* Examples:

* @return string The corrected url.
*
* Examples:

* <code>
* append_sid("{$phpbb_root_path}viewtopic.$phpEx?t=1&amp;f=2");
* append_sid("{$phpbb_root_path}viewtopic.$phpEx", 't=1&amp;f=2');
* append_sid("{$phpbb_root_path}viewtopic.$phpEx", 't=1&f=2', false);

* <code> append_sid("{$phpbb_root_path}viewtopic.$phpEx?t=1");
* append_sid("{$phpbb_root_path}viewtopic.$phpEx", 't=1');
* append_sid("{$phpbb_root_path}viewtopic.$phpEx", 't=1', false);


* append_sid("{$phpbb_root_path}viewtopic.$phpEx", array('t' => 1, 'f' => 2));
* </code>
*

* append_sid("{$phpbb_root_path}viewtopic.$phpEx", array('t' => 1, 'f' => 2));
* </code>
*

Line 1834Line 1820
	// Behave as per HTTP/1.1 spec for others
header('Location: ' . $url);
exit;

	// Behave as per HTTP/1.1 spec for others
header('Location: ' . $url);
exit;

 
}

/**
* Returns the install redirect path for phpBB.
*
* @param string $phpbb_root_path The root path of the phpBB installation.
* @param string $phpEx The file extension of php files, e.g., "php".
* @return string The install redirect path.
*/
function phpbb_get_install_redirect(string $phpbb_root_path, string $phpEx): string
{
$script_name = (!empty($_SERVER['REQUEST_URI'])) ? $_SERVER['REQUEST_URI'] : getenv('REQUEST_URI');
if (!$script_name)
{
$script_name = (!empty($_SERVER['PHP_SELF'])) ? $_SERVER['PHP_SELF'] : getenv('PHP_SELF');
}

// Add trailing dot to prevent dirname() from returning parent directory if $script_name is a directory
$script_name = substr($script_name, -1) === '/' ? $script_name . '.' : $script_name;

// $phpbb_root_path accounts for redirects from e.g. /adm
$script_path = trim(dirname($script_name)) . '/' . $phpbb_root_path . 'install/app.' . $phpEx;
// Replace any number of consecutive backslashes and/or slashes with a single slash
// (could happen on some proxy setups and/or Windows servers)
return preg_replace('#[\\\\/]{2,}#', '/', $script_path);

}

/**

}

/**

Line 2276Line 2287

$err = '';
$form_name = 'login';


$err = '';
$form_name = 'login';

 
	$username = $autologin = false;


// Make sure user->setup() has been called
if (!$user->is_setup())


// Make sure user->setup() has been called
if (!$user->is_setup())

Line 2523Line 2535
		'LOGIN_ERROR'		=> $err,
'LOGIN_EXPLAIN' => $l_explain,


		'LOGIN_ERROR'		=> $err,
'LOGIN_EXPLAIN' => $l_explain,


		'U_SEND_PASSWORD' 		=> ($config['email_enable']) ? $controller_helper->route('phpbb_ucp_forgot_password_controller') : '',

		'U_SEND_PASSWORD' 		=> ($config['email_enable'] && $config['allow_password_reset']) ? $controller_helper->route('phpbb_ucp_forgot_password_controller') : '',

		'U_RESEND_ACTIVATION'	=> ($config['require_activation'] == USER_ACTIVATION_SELF && $config['email_enable']) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=resend_act') : '',
'U_TERMS_USE' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=terms'),
'U_PRIVACY' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=privacy'),

		'U_RESEND_ACTIVATION'	=> ($config['require_activation'] == USER_ACTIVATION_SELF && $config['email_enable']) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=resend_act') : '',
'U_TERMS_USE' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=terms'),
'U_PRIVACY' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=privacy'),

Line 2742Line 2754
		}

// Determine first occurrence, since in values the equal sign is allowed

		}

// Determine first occurrence, since in values the equal sign is allowed

		$key = htmlspecialchars(strtolower(trim(substr($line, 0, $delim_pos))));

		$key = htmlspecialchars(strtolower(trim(substr($line, 0, $delim_pos))), ENT_COMPAT);

		$value = trim(substr($line, $delim_pos + 1));

if (in_array($value, array('off', 'false', '0')))

		$value = trim(substr($line, $delim_pos + 1));

if (in_array($value, array('off', 'false', '0')))

Line 2759Line 2771
		}
else if (($value[0] == "'" && $value[strlen($value) - 1] == "'") || ($value[0] == '"' && $value[strlen($value) - 1] == '"'))
{

		}
else if (($value[0] == "'" && $value[strlen($value) - 1] == "'") || ($value[0] == '"' && $value[strlen($value) - 1] == '"'))
{

			$value = htmlspecialchars(substr($value, 1, strlen($value)-2));

			$value = htmlspecialchars(substr($value, 1, strlen($value)-2), ENT_COMPAT);

		}
else
{

		}
else
{

			$value = htmlspecialchars($value);

			$value = htmlspecialchars($value, ENT_COMPAT);

		}

$parsed_items[$key] = $value;

		}

$parsed_items[$key] = $value;

Line 2796Line 2808
	foreach ($backtrace as $trace)
{
// Strip the current directory from path

	foreach ($backtrace as $trace)
{
// Strip the current directory from path

		$trace['file'] = (empty($trace['file'])) ? '(not given by php)' : htmlspecialchars(phpbb_filter_root_path($trace['file']));

		$trace['file'] = (empty($trace['file'])) ? '(not given by php)' : htmlspecialchars(phpbb_filter_root_path($trace['file']), ENT_COMPAT);

		$trace['line'] = (empty($trace['line'])) ? '(not given by php)' : $trace['line'];

// Only show function arguments for include etc.

		$trace['line'] = (empty($trace['line'])) ? '(not given by php)' : $trace['line'];

// Only show function arguments for include etc.

Line 2804Line 2816
		$argument = '';
if (!empty($trace['args'][0]) && in_array($trace['function'], array('include', 'require', 'include_once', 'require_once')))
{

		$argument = '';
if (!empty($trace['args'][0]) && in_array($trace['function'], array('include', 'require', 'include_once', 'require_once')))
{

			$argument = htmlspecialchars(phpbb_filter_root_path($trace['args'][0]));

			$argument = htmlspecialchars(phpbb_filter_root_path($trace['args'][0]), ENT_COMPAT);

		}

$trace['class'] = (!isset($trace['class'])) ? '' : $trace['class'];

		}

$trace['class'] = (!isset($trace['class'])) ? '' : $trace['class'];

Line 2814Line 2826
		$output .= '<b>FILE:</b> ' . $trace['file'] . '<br />';
$output .= '<b>LINE:</b> ' . ((!empty($trace['line'])) ? $trace['line'] : '') . '<br />';


		$output .= '<b>FILE:</b> ' . $trace['file'] . '<br />';
$output .= '<b>LINE:</b> ' . ((!empty($trace['line'])) ? $trace['line'] : '') . '<br />';


		$output .= '<b>CALL:</b> ' . htmlspecialchars($trace['class'] . $trace['type'] . $trace['function']);

		$output .= '<b>CALL:</b> ' . htmlspecialchars($trace['class'] . $trace['type'] . $trace['function'], ENT_COMPAT);

		$output .= '(' . (($argument !== '') ? "'$argument'" : '') . ')<br />';
}
$output .= '</div>';

		$output .= '(' . (($argument !== '') ? "'$argument'" : '') . ')<br />';
}
$output .= '</div>';

Line 2851Line 2863
		// Whoa these look impressive!
// The code to generate the following two regular expressions which match valid IPv4/IPv6 addresses
// can be found in the develop directory

		// Whoa these look impressive!
// The code to generate the following two regular expressions which match valid IPv4/IPv6 addresses
// can be found in the develop directory

 

// @deprecated

		case 'ipv4':
return '#^(?:(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$#';
break;


		case 'ipv4':
return '#^(?:(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$#';
break;


 
		// @deprecated

		case 'ipv6':
return '#^(?:(?:(?:[\dA-F]{1,4}:){6}(?:[\dA-F]{1,4}:[\dA-F]{1,4}|(?:(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])))|(?:::(?:[\dA-F]{1,4}:){0,5}(?:[\dA-F]{1,4}(?::[\dA-F]{1,4})?|(?:(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])))|(?:(?:[\dA-F]{1,4}:):(?:[\dA-F]{1,4}:){4}(?:[\dA-F]{1,4}:[\dA-F]{1,4}|(?:(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])))|(?:(?:[\dA-F]{1,4}:){1,2}:(?:[\dA-F]{1,4}:){3}(?:[\dA-F]{1,4}:[\dA-F]{1,4}|(?:(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])))|(?:(?:[\dA-F]{1,4}:){1,3}:(?:[\dA-F]{1,4}:){2}(?:[\dA-F]{1,4}:[\dA-F]{1,4}|(?:(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])))|(?:(?:[\dA-F]{1,4}:){1,4}:(?:[\dA-F]{1,4}:)(?:[\dA-F]{1,4}:[\dA-F]{1,4}|(?:(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])))|(?:(?:[\dA-F]{1,4}:){1,5}:(?:[\dA-F]{1,4}:[\dA-F]{1,4}|(?:(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])))|(?:(?:[\dA-F]{1,4}:){1,6}:[\dA-F]{1,4})|(?:(?:[\dA-F]{1,4}:){1,7}:)|(?:::))$#i';
break;

		case 'ipv6':
return '#^(?:(?:(?:[\dA-F]{1,4}:){6}(?:[\dA-F]{1,4}:[\dA-F]{1,4}|(?:(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])))|(?:::(?:[\dA-F]{1,4}:){0,5}(?:[\dA-F]{1,4}(?::[\dA-F]{1,4})?|(?:(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])))|(?:(?:[\dA-F]{1,4}:):(?:[\dA-F]{1,4}:){4}(?:[\dA-F]{1,4}:[\dA-F]{1,4}|(?:(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])))|(?:(?:[\dA-F]{1,4}:){1,2}:(?:[\dA-F]{1,4}:){3}(?:[\dA-F]{1,4}:[\dA-F]{1,4}|(?:(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])))|(?:(?:[\dA-F]{1,4}:){1,3}:(?:[\dA-F]{1,4}:){2}(?:[\dA-F]{1,4}:[\dA-F]{1,4}|(?:(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])))|(?:(?:[\dA-F]{1,4}:){1,4}:(?:[\dA-F]{1,4}:)(?:[\dA-F]{1,4}:[\dA-F]{1,4}|(?:(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])))|(?:(?:[\dA-F]{1,4}:){1,5}:(?:[\dA-F]{1,4}:[\dA-F]{1,4}|(?:(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])))|(?:(?:[\dA-F]{1,4}:){1,6}:[\dA-F]{1,4})|(?:(?:[\dA-F]{1,4}:){1,7}:)|(?:::))$#i';
break;

Line 2936Line 2951

/**
* Returns the first block of the specified IPv6 address and as many additional


/**
* Returns the first block of the specified IPv6 address and as many additional

* ones as specified in the length paramater.

* ones as specified in the length parameter.

* If length is zero, then an empty string is returned.
* If length is greater than 3 the complete IP will be returned
*/

* If length is zero, then an empty string is returned.
* If length is greater than 3 the complete IP will be returned
*/

Line 2945Line 2960
	if ($length < 1)
{
return '';

	if ($length < 1)
{
return '';

 
	}

// Handle IPv4 embedded IPv6 addresses
if (preg_match('/(?:\d{1,3}\.){3}\d{1,3}$/i', $ip))
{
$binary_ip = inet_pton($ip);
$ip_v6 = $binary_ip ? inet_ntop($binary_ip) : $ip;
$ip = $ip_v6 ?: $ip;

	}

// extend IPv6 addresses

	}

// extend IPv6 addresses

Line 2980Line 3003
* @return mixed		false if specified address is not valid,
* string otherwise
*/

* @return mixed		false if specified address is not valid,
* string otherwise
*/

function phpbb_ip_normalise($address)

function phpbb_ip_normalise(string $address)

{

{

	$address = trim($address);

	$ip_normalised = false;





	if (empty($address) || !is_string($address))

	if (filter_var($address, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4))

	{

	{

		return false;

		$ip_normalised = $address;

	}

	}


if (preg_match(get_preg_expression('ipv4'), $address))

	else if (filter_var($address, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6))


	{

	{

		return $address;
}

		$ip_normalised = inet_ntop(inet_pton($address));






	return phpbb_inet_ntop(phpbb_inet_pton($address));
}

/**
* Wrapper for inet_ntop()
*
* Converts a packed internet address to a human readable representation
* inet_ntop() is supported by PHP since 5.1.0, since 5.3.0 also on Windows.
*
* @param string $in_addr A 32bit IPv4, or 128bit IPv6 address.
*
* @return mixed false on failure,
* string otherwise
*/
function phpbb_inet_ntop($in_addr)

		// If is ipv4
if (stripos($ip_normalised, '::ffff:') === 0)














{

{

	$in_addr = bin2hex($in_addr);

switch (strlen($in_addr))
{
case 8:
return implode('.', array_map('hexdec', str_split($in_addr, 2)));

case 32:
if (substr($in_addr, 0, 24) === '00000000000000000000ffff')
{
return phpbb_inet_ntop(pack('H*', substr($in_addr, 24)));

			$ip_normalised = substr($ip_normalised, 7);











			}

			}


$parts = str_split($in_addr, 4);
$parts = preg_replace('/^0+(?!$)/', '', $parts);
$ret = implode(':', $parts);

$matches = array();
preg_match_all('/(?<=:|^)(?::?0){2,}/', $ret, $matches, PREG_OFFSET_CAPTURE);
$matches = $matches[0];

if (empty($matches))
{
return $ret;

 
			}


			}


			$longest_match = '';
$longest_match_offset = 0;
foreach ($matches as $match)
{
if (strlen($match[0]) > strlen($longest_match))
{
$longest_match = $match[0];
$longest_match_offset = $match[1];
}
}

$ret = substr_replace($ret, '', $longest_match_offset, strlen($longest_match));

if ($longest_match_offset == strlen($ret))
{
$ret .= ':';
}

if ($longest_match_offset == 0)
{
$ret = ':' . $ret;
}

return $ret;

default:
return false;
}
}

/**
* Wrapper for inet_pton()
*
* Converts a human readable IP address to its packed in_addr representation
* inet_pton() is supported by PHP since 5.1.0, since 5.3.0 also on Windows.
*
* @param string $address A human readable IPv4 or IPv6 address.
*
* @return mixed false if address is invalid,
* in_addr representation of the given address otherwise (string)
*/
function phpbb_inet_pton($address)
{
$ret = '';
if (preg_match(get_preg_expression('ipv4'), $address))
{
foreach (explode('.', $address) as $part)
{
$ret .= ($part <= 0xF ? '0' : '') . dechex($part);
}

return pack('H*', $ret);
}

if (preg_match(get_preg_expression('ipv6'), $address))
{
$parts = explode(':', $address);
$missing_parts = 8 - count($parts) + 1;

if (substr($address, 0, 2) === '::')
{
++$missing_parts;
}

if (substr($address, -2) === '::')
{
++$missing_parts;
}

$embedded_ipv4 = false;
$last_part = end($parts);

if (preg_match(get_preg_expression('ipv4'), $last_part))
{
$parts[count($parts) - 1] = '';
$last_part = phpbb_inet_pton($last_part);
$embedded_ipv4 = true;
--$missing_parts;
}

foreach ($parts as $i => $part)
{
if (strlen($part))
{
$ret .= str_pad($part, 4, '0', STR_PAD_LEFT);
}
else if ($i && $i < count($parts) - 1)
{
$ret .= str_repeat('0000', $missing_parts);
}
}

$ret = pack('H*', $ret);

if ($embedded_ipv4)
{
$ret .= $last_part;
}

return $ret;
}

return false;
}

/**
* Wrapper for php's checkdnsrr function.
*
* @param string $host Fully-Qualified Domain Name
* @param string $type Resource record type to lookup
* Supported types are: MX (default), A, AAAA, NS, TXT, CNAME
* Other types may work or may not work
*
* @return mixed true if entry found,
* false if entry not found,
* null if this function is not supported by this environment
*
* Since null can also be returned, you probably want to compare the result
* with === true or === false,
*/
function phpbb_checkdnsrr($host, $type = 'MX')
{
// The dot indicates to search the DNS root (helps those having DNS prefixes on the same domain)
if (substr($host, -1) == '.')
{
$host_fqdn = $host;
$host = substr($host, 0, -1);
}
else
{
$host_fqdn = $host . '.';
}
// $host has format some.host.example.com
// $host_fqdn has format some.host.example.com.

// If we're looking for an A record we can use gethostbyname()
if ($type == 'A' && function_exists('gethostbyname'))
{
return (@gethostbyname($host_fqdn) == $host_fqdn) ? false : true;
}

if (function_exists('checkdnsrr'))
{
return checkdnsrr($host_fqdn, $type);
}

if (function_exists('dns_get_record'))
{
// dns_get_record() expects an integer as second parameter
// We have to convert the string $type to the corresponding integer constant.
$type_constant = 'DNS_' . $type;
$type_param = (defined($type_constant)) ? constant($type_constant) : DNS_ANY;

// dns_get_record() might throw E_WARNING and return false for records that do not exist
$resultset = @dns_get_record($host_fqdn, $type_param);

if (empty($resultset) || !is_array($resultset))
{
return false;
}
else if ($type_param == DNS_ANY)
{
// $resultset is a non-empty array
return true;
}

foreach ($resultset as $result)
{
if (
isset($result['host']) && $result['host'] == $host &&
isset($result['type']) && $result['type'] == $type
)
{
return true;
}
}

return false;
}

// If we're on Windows we can still try to call nslookup via exec() as a last resort
if (DIRECTORY_SEPARATOR == '\\' && function_exists('exec'))
{
@exec('nslookup -type=' . escapeshellarg($type) . ' ' . escapeshellarg($host_fqdn), $output);

// If output is empty, the nslookup failed
if (empty($output))
{
return NULL;
}

foreach ($output as $line)
{
$line = trim($line);

if (empty($line))
{
continue;
}

// Squash tabs and multiple whitespaces to a single whitespace.
$line = preg_replace('/\s+/', ' ', $line);

switch ($type)
{
case 'MX':
if (stripos($line, "$host MX") === 0)
{
return true;
}
break;

case 'NS':
if (stripos($line, "$host nameserver") === 0)
{
return true;
}
break;

case 'TXT':
if (stripos($line, "$host text") === 0)
{
return true;
}
break;

case 'CNAME':
if (stripos($line, "$host canonical name") === 0)
{
return true;
}
break;

default:
case 'AAAA':
// AAAA records returned by nslookup on Windows XP/2003 have this format.
// Later Windows versions use the A record format below for AAAA records.
if (stripos($line, "$host AAAA IPv6 address") === 0)
{
return true;
}
// No break

case 'A':
if (!empty($host_matches))
{
// Second line
if (stripos($line, "Address: ") === 0)
{
return true;
}
else
{
$host_matches = false;
}
}
else if (stripos($line, "Name: $host") === 0)
{
// First line
$host_matches = true;
}
break;
}
}

return false;
}

return NULL;

	return $ip_normalised;













































































































































































































































































}

// Handler, header and footer

}

// Handler, header and footer

Line 3317Line 3035
	global $cache, $db, $auth, $template, $config, $user, $request;
global $phpbb_root_path, $msg_title, $msg_long_text, $phpbb_log;
global $phpbb_container;

	global $cache, $db, $auth, $template, $config, $user, $request;
global $phpbb_root_path, $msg_title, $msg_long_text, $phpbb_log;
global $phpbb_container;

 

// https://www.php.net/manual/en/language.operators.errorcontrol.php
// error_reporting() return a different error code inside the error handler after php 8.0
$suppresed = E_ERROR | E_CORE_ERROR | E_COMPILE_ERROR | E_USER_ERROR | E_RECOVERABLE_ERROR | E_PARSE;
if (PHP_VERSION_ID < 80000)
{
$suppresed = 0;
}


// Do not display notices if we suppress them via @


// Do not display notices if we suppress them via @

	if (error_reporting() == 0 && $errno != E_USER_ERROR && $errno != E_USER_WARNING && $errno != E_USER_NOTICE)

	if (error_reporting() == $suppresed && $errno != E_USER_ERROR && $errno != E_USER_WARNING && $errno != E_USER_NOTICE)

	{
return;
}

	{
return;
}

Line 3337Line 3063

// Check the error reporting level and return if the error level does not match
// If DEBUG is defined the default level is E_ALL


// Check the error reporting level and return if the error level does not match
// If DEBUG is defined the default level is E_ALL

			if (($errno & ($phpbb_container->getParameter('debug.show_errors') ? E_ALL : error_reporting())) == 0)

			if (($errno & ($phpbb_container != null && $phpbb_container->getParameter('debug.show_errors') ? E_ALL : error_reporting())) == 0)

			{
return;
}

			{
return;
}

Line 3581Line 3307
	{
if ($phpbb_filesystem)
{

	{
if ($phpbb_filesystem)
{

			$root_path = $phpbb_filesystem->realpath(dirname(__FILE__) . '/../');

			$root_path = $phpbb_filesystem->realpath(__DIR__ . '/../');

		}
else
{
$filesystem = new \phpbb\filesystem\filesystem();

		}
else
{
$filesystem = new \phpbb\filesystem\filesystem();

			$root_path = $filesystem->realpath(dirname(__FILE__) . '/../');

			$root_path = $filesystem->realpath(__DIR__ . '/../');

		}
}


		}
}


Line 3893Line 3619
	return $data;
}


	return $data;
}


/**
* Login using http authenticate.
*
* @param array $param Parameter array, see $param_defaults array.
*
* @return null
*/
function phpbb_http_login($param)
{
global $auth, $user, $request;
global $config;

$param_defaults = array(
'auth_message' => '',

'autologin' => false,
'viewonline' => true,
'admin' => false,
);

// Overwrite default values with passed values
$param = array_merge($param_defaults, $param);

// User is already logged in
// We will not overwrite his session
if (!empty($user->data['is_registered']))
{
return;
}

// $_SERVER keys to check
$username_keys = array(
'PHP_AUTH_USER',
'Authorization',
'REMOTE_USER', 'REDIRECT_REMOTE_USER',
'HTTP_AUTHORIZATION', 'REDIRECT_HTTP_AUTHORIZATION',
'REMOTE_AUTHORIZATION', 'REDIRECT_REMOTE_AUTHORIZATION',
'AUTH_USER',
);

$password_keys = array(
'PHP_AUTH_PW',
'REMOTE_PASSWORD',
'AUTH_PASSWORD',
);

$username = null;
foreach ($username_keys as $k)
{
if ($request->is_set($k, \phpbb\request\request_interface::SERVER))
{
$username = htmlspecialchars_decode($request->server($k));
break;
}
}

$password = null;
foreach ($password_keys as $k)
{
if ($request->is_set($k, \phpbb\request\request_interface::SERVER))
{
$password = htmlspecialchars_decode($request->server($k));
break;
}
}

// Decode encoded information (IIS, CGI, FastCGI etc.)
if (!is_null($username) && is_null($password) && strpos($username, 'Basic ') === 0)
{
list($username, $password) = explode(':', base64_decode(substr($username, 6)), 2);
}

if (!is_null($username) && !is_null($password))
{
set_var($username, $username, 'string', true);
set_var($password, $password, 'string', true);

$auth_result = $auth->login($username, $password, $param['autologin'], $param['viewonline'], $param['admin']);

if ($auth_result['status'] == LOGIN_SUCCESS)
{
return;
}
else if ($auth_result['status'] == LOGIN_ERROR_ATTEMPTS)
{
send_status_line(401, 'Unauthorized');

trigger_error('NOT_AUTHORISED');
}
}

// Prepend sitename to auth_message
$param['auth_message'] = ($param['auth_message'] === '') ? $config['sitename'] : $config['sitename'] . ' - ' . $param['auth_message'];

// We should probably filter out non-ASCII characters - RFC2616
$param['auth_message'] = preg_replace('/[\x80-\xFF]/', '?', $param['auth_message']);

header('WWW-Authenticate: Basic realm="' . $param['auth_message'] . '"');
send_status_line(401, 'Unauthorized');

trigger_error('NOT_AUTHORISED');
}

 

/**
* Escapes and quotes a string for use as an HTML/XML attribute value.


/**
* Escapes and quotes a string for use as an HTML/XML attribute value.

Line 4041Line 3665
	}

return $data;

	}

return $data;

}

/**
* Converts query string (GET) parameters in request into hidden fields.
*
* Useful for forwarding GET parameters when submitting forms with GET method.
*
* It is possible to omit some of the GET parameters, which is useful if
* they are specified in the form being submitted.
*
* sid is always omitted.
*
* @param \phpbb\request\request $request Request object
* @param array $exclude A list of variable names that should not be forwarded
* @return string HTML with hidden fields
*/
function phpbb_build_hidden_fields_for_query_params($request, $exclude = null)
{
$names = $request->variable_names(\phpbb\request\request_interface::GET);
$hidden = '';
foreach ($names as $name)
{
// Sessions are dealt with elsewhere, omit sid always
if ($name == 'sid')
{
continue;
}

// Omit any additional parameters requested
if (!empty($exclude) && in_array($name, $exclude))
{
continue;
}

$escaped_name = phpbb_quoteattr($name);

// Note: we might retrieve the variable from POST or cookies
// here. To avoid exposing cookies, skip variables that are
// overwritten somewhere other than GET entirely.
$value = $request->variable($name, '', true);
$get_value = $request->variable($name, '', true, \phpbb\request\request_interface::GET);
if ($value === $get_value)
{
$escaped_value = phpbb_quoteattr($value);
$hidden .= "<input type='hidden' name=$escaped_name value=$escaped_value />";
}
}
return $hidden;

 
}

/**

}

/**

Line 4168Line 3744
	{
if ($lazy)
{

	{
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');

			// 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;

			$web_path = $phpbb_path_helper->get_web_root_path();




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



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


Line 4347Line 3919
		}
}


		}
}


	$forum_id = $request->variable('f', 0);
$topic_id = $request->variable('t', 0);


	// Negative forum and topic IDs are not allowed
$forum_id = max(0, $request->variable('f', 0));
$topic_id = max(0, $request->variable('t', 0));


$s_feed_news = false;



$s_feed_news = false;


Line 4363Line 3936
		$db->sql_freeresult($result);
}


		$db->sql_freeresult($result);
}


	// 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.
/* @var $phpbb_path_helper \phpbb\path_helper */
$phpbb_path_helper = $phpbb_container->get('path_helper');

	// 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.
/* @var $phpbb_path_helper \phpbb\path_helper */
$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;

	$web_path = $phpbb_path_helper->get_web_root_path();



// Send a proper content-language to the output
$user_lang = $user->lang['USER_LANG'];


// Send a proper content-language to the output
$user_lang = $user->lang['USER_LANG'];

Line 4432Line 4002

/**
* Workaround for missing template variable in pre phpBB 3.2.6 styles.


/**
* Workaround for missing template variable in pre phpBB 3.2.6 styles.

	 * @deprecated 3.2.7 (To be removed: 3.3.0-a1)

	 * @deprecated 3.2.7 (To be removed: 4.0.0-a1)

	 */
$form_token_login = $template->retrieve_var('S_FORM_TOKEN_LOGIN');
if (!empty($form_token_login))

	 */
$form_token_login = $template->retrieve_var('S_FORM_TOKEN_LOGIN');
if (!empty($form_token_login))

Line 4474Line 4044
		'_SID'				=> $_SID,
'SESSION_ID' => $user->session_id,
'ROOT_PATH' => $web_path,

		'_SID'				=> $_SID,
'SESSION_ID' => $user->session_id,
'ROOT_PATH' => $web_path,

		'BOARD_URL'			=> $board_url,

		'BOARD_URL'			=> generate_board_url() . '/',


'L_LOGIN_LOGOUT' => $l_login_logout,
'L_INDEX' => ($config['board_index_text'] !== '') ? $config['board_index_text'] : $user->lang['FORUM_INDEX'],


'L_LOGIN_LOGOUT' => $l_login_logout,
'L_INDEX' => ($config['board_index_text'] !== '') ? $config['board_index_text'] : $user->lang['FORUM_INDEX'],

Line 4499Line 4069
		'U_SEARCH_UNANSWERED'	=> append_sid("{$phpbb_root_path}search.$phpEx", 'search_id=unanswered'),
'U_SEARCH_UNREAD' => append_sid("{$phpbb_root_path}search.$phpEx", 'search_id=unreadposts'),
'U_SEARCH_ACTIVE_TOPICS'=> append_sid("{$phpbb_root_path}search.$phpEx", 'search_id=active_topics'),

		'U_SEARCH_UNANSWERED'	=> append_sid("{$phpbb_root_path}search.$phpEx", 'search_id=unanswered'),
'U_SEARCH_UNREAD' => append_sid("{$phpbb_root_path}search.$phpEx", 'search_id=unreadposts'),
'U_SEARCH_ACTIVE_TOPICS'=> append_sid("{$phpbb_root_path}search.$phpEx", 'search_id=active_topics'),

		'U_DELETE_COOKIES'		=> append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=delete_cookies'),

		'U_DELETE_COOKIES'		=> $controller_helper->route('phpbb_ucp_delete_cookies_controller'),

		'U_CONTACT_US'			=> ($config['contact_admin_form_enable'] && $config['email_enable']) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=contactadmin') : '',
'U_TEAM' => (!$auth->acl_get('u_viewprofile')) ? '' : append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=team'),
'U_TERMS_USE' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=terms'),

		'U_CONTACT_US'			=> ($config['contact_admin_form_enable'] && $config['email_enable']) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=contactadmin') : '',
'U_TEAM' => (!$auth->acl_get('u_viewprofile')) ? '' : append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=team'),
'U_TERMS_USE' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=terms'),

Line 4540Line 4110
		'S_ENABLE_FEEDS_TOPICS_ACTIVE'	=> ($config['feed_topics_active']) ? true : false,
'S_ENABLE_FEEDS_NEWS' => ($s_feed_news) ? true : false,


		'S_ENABLE_FEEDS_TOPICS_ACTIVE'	=> ($config['feed_topics_active']) ? true : false,
'S_ENABLE_FEEDS_NEWS' => ($s_feed_news) ? true : false,


		'S_LOAD_UNREADS'			=> ($config['load_unreads_search'] && ($config['load_anon_lastread'] || $user->data['is_registered'])) ? true : false,

		'S_LOAD_UNREADS'			=> (bool) $config['load_unreads_search'] && ($config['load_anon_lastread'] || !empty($user->data['is_registered'])),


'S_SEARCH_HIDDEN_FIELDS' => build_hidden_fields($s_search_hidden_fields),



'S_SEARCH_HIDDEN_FIELDS' => build_hidden_fields($s_search_hidden_fields),


Line 4558Line 4128
		'T_UPLOAD_PATH'			=> "{$web_path}{$config['upload_path']}/",
'T_STYLESHEET_LINK' => "{$web_path}styles/" . rawurlencode($user->style['style_path']) . '/theme/stylesheet.css?assets_version=' . $config['assets_version'],
'T_STYLESHEET_LANG_LINK'=> "{$web_path}styles/" . rawurlencode($user->style['style_path']) . '/theme/' . $user->lang_name . '/stylesheet.css?assets_version=' . $config['assets_version'],

		'T_UPLOAD_PATH'			=> "{$web_path}{$config['upload_path']}/",
'T_STYLESHEET_LINK' => "{$web_path}styles/" . rawurlencode($user->style['style_path']) . '/theme/stylesheet.css?assets_version=' . $config['assets_version'],
'T_STYLESHEET_LANG_LINK'=> "{$web_path}styles/" . rawurlencode($user->style['style_path']) . '/theme/' . $user->lang_name . '/stylesheet.css?assets_version=' . $config['assets_version'],

 


		'T_FONT_AWESOME_LINK'	=> !empty($config['allow_cdn']) && !empty($config['load_font_awesome_url']) ? $config['load_font_awesome_url'] : "{$web_path}assets/css/font-awesome.min.css?assets_version=" . $config['assets_version'],

		'T_FONT_AWESOME_LINK'	=> !empty($config['allow_cdn']) && !empty($config['load_font_awesome_url']) ? $config['load_font_awesome_url'] : "{$web_path}assets/css/font-awesome.min.css?assets_version=" . $config['assets_version'],

		'T_JQUERY_LINK'			=> !empty($config['allow_cdn']) && !empty($config['load_jquery_url']) ? $config['load_jquery_url'] : "{$web_path}assets/javascript/jquery-3.4.1.min.js?assets_version=" . $config['assets_version'],



'T_JQUERY_LINK' => !empty($config['allow_cdn']) && !empty($config['load_jquery_url']) ? $config['load_jquery_url'] : "{$web_path}assets/javascript/jquery-3.7.1.min.js?assets_version=" . $config['assets_version'],

		'S_ALLOW_CDN'			=> !empty($config['allow_cdn']),
'S_COOKIE_NOTICE' => !empty($config['cookie_notice']),


		'S_ALLOW_CDN'			=> !empty($config['allow_cdn']),
'S_COOKIE_NOTICE' => !empty($config['cookie_notice']),


Line 4628Line 4200
* @param \phpbb\request\request_interface		$request	Request object
* @param \phpbb\auth\auth $auth Auth object
* @param \phpbb\db\driver\driver_interface $db Database connection

* @param \phpbb\request\request_interface		$request	Request object
* @param \phpbb\auth\auth $auth Auth object
* @param \phpbb\db\driver\driver_interface $db Database connection

 
 *
* @deprecated 3.3.1 (To be removed: 4.0.0-a1); use controller helper's display_sql_report()

*/
function phpbb_check_and_display_sql_report(\phpbb\request\request_interface $request, \phpbb\auth\auth $auth, \phpbb\db\driver\driver_interface $db)
{
global $phpbb_container;


*/
function phpbb_check_and_display_sql_report(\phpbb\request\request_interface $request, \phpbb\auth\auth $auth, \phpbb\db\driver\driver_interface $db)
{
global $phpbb_container;


	if ($phpbb_container->getParameter('debug.sql_explain') && $request->variable('explain', false) && $auth->acl_get('a_'))
{
$db->sql_report('display');
}

	/** @var \phpbb\controller\helper $controller_helper */
$controller_helper = $phpbb_container->get('controller.helper');

$controller_helper->display_sql_report();

}

/**

}

/**

Line 4716Line 4290
*/
function page_footer($run_cron = true, $display_template = true, $exit_handler = true)
{

*/
function page_footer($run_cron = true, $display_template = true, $exit_handler = true)
{

	global $db, $config, $template, $user, $auth, $cache, $phpEx;
global $request, $phpbb_dispatcher, $phpbb_admin_path;

	global $phpbb_dispatcher, $phpbb_container, $template;



// A listener can set this variable to `true` when it overrides this function
$page_footer_override = false;


// A listener can set this variable to `true` when it overrides this function
$page_footer_override = false;

Line 4739Line 4312
		return;
}


		return;
}


	phpbb_check_and_display_sql_report($request, $auth, $db);


	/** @var \phpbb\controller\helper $controller_helper */
$controller_helper = $phpbb_container->get('controller.helper');





	$template->assign_vars(array(
'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'),

'U_ACP' => ($auth->acl_get('a_') && !empty($user->data['is_registered'])) ? append_sid("{$phpbb_admin_path}index.$phpEx", false, true, $user->session_id) : '')
);

// Call cron-type script
$call_cron = false;
if (!defined('IN_CRON') && !$config['use_system_cron'] && $run_cron && !$config['board_disable'] && !$user->data['is_bot'] && !$cache->get('_cron.lock_check'))
{
$call_cron = true;
$time_now = (!empty($user->time_now) && is_int($user->time_now)) ? $user->time_now : time();

// Any old lock present?
if (!empty($config['cron_lock']))
{
$cron_time = explode(' ', $config['cron_lock']);

// If 1 hour lock is present we do not call cron.php
if ($cron_time[0] + 3600 >= $time_now)
{
$call_cron = false;
}
}
}

// Call cron job?
if ($call_cron)
{
global $phpbb_container;

/* @var $cron \phpbb\cron\manager */
$cron = $phpbb_container->get('cron.manager');
$task = $cron->find_one_ready_task();

if ($task)
{
$url = $task->get_url();
$template->assign_var('RUN_CRON_TASK', '<img src="' . $url . '" width="1" height="1" alt="cron" />');
}
else
{
$cache->put('_cron.lock_check', true, 60);
}
}

	$controller_helper->display_footer($run_cron);
















































/**
* Execute code and/or modify output before displaying the template.


/**
* Execute code and/or modify output before displaying the template.

Line 4938Line 4466
	}
else
{

	}
else
{

		return 'mailto:' . htmlspecialchars($config['board_contact']);

		return 'mailto:' . htmlspecialchars($config['board_contact'], ENT_COMPAT);

	}
}


	}
}