phpBB

Code Changes

File: includes/acp/acp_main.php

  Unmodified   Added   Modified   Removed
Line 22Line 22
class acp_main
{
var $u_action;

class acp_main
{
var $u_action;

 
	private $php_ini;


function main($id, $mode)
{


function main($id, $mode)
{

Line 429Line 430
		// Version check
$user->add_lang('install');


		// Version check
$user->add_lang('install');


		if ($auth->acl_get('a_server') && version_compare(PHP_VERSION, '5.4.0', '<'))

		if ($auth->acl_get('a_server') && version_compare(PHP_VERSION, '7.2.0', '<'))

		{
$template->assign_vars(array(
'S_PHP_VERSION_OLD' => true,

		{
$template->assign_vars(array(
'S_PHP_VERSION_OLD' => true,

				'L_PHP_VERSION_OLD'	=> sprintf($user->lang['PHP_VERSION_OLD'], PHP_VERSION, '5.4.0', '<a href="https://www.phpbb.com/support/docs/en/3.2/ug/quickstart/requirements">', '</a>'),

				'L_PHP_VERSION_OLD'	=> sprintf($user->lang['PHP_VERSION_OLD'], PHP_VERSION, '7.2.0', '<a href="https://www.phpbb.com/support/docs/en/3.3/ug/quickstart/requirements">', '</a>'),

			));
}


			));
}


Line 453Line 454
				$template->assign_vars(array(
'S_VERSION_UP_TO_DATE' => empty($updates_available),
'S_VERSION_UPGRADEABLE' => !empty($upgrades_available),

				$template->assign_vars(array(
'S_VERSION_UP_TO_DATE' => empty($updates_available),
'S_VERSION_UPGRADEABLE' => !empty($upgrades_available),

 
					'S_VERSIONCHECK_FORCE'		=> (bool) $recheck,

					'UPGRADE_INSTRUCTIONS'		=> !empty($upgrades_available) ? $user->lang('UPGRADE_INSTRUCTIONS', $upgrades_available['current'], $upgrades_available['announcement']) : false,
));
}

					'UPGRADE_INSTRUCTIONS'		=> !empty($upgrades_available) ? $user->lang('UPGRADE_INSTRUCTIONS', $upgrades_available['current'], $upgrades_available['announcement']) : false,
));
}

Line 493Line 495

$start_date = $user->format_date($config['board_startdate']);



$start_date = $user->format_date($config['board_startdate']);


		$boarddays = (time() - $config['board_startdate']) / 86400;

		$boarddays = (time() - (int) $config['board_startdate']) / 86400;


$posts_per_day = sprintf('%.2f', $total_posts / $boarddays);
$topics_per_day = sprintf('%.2f', $total_topics / $boarddays);


$posts_per_day = sprintf('%.2f', $total_posts / $boarddays);
$topics_per_day = sprintf('%.2f', $total_topics / $boarddays);

Line 543Line 545
			$files_per_day = $total_files;
}


			$files_per_day = $total_files;
}


		if ($config['allow_attachments'] || $config['allow_pm_attach'])
{

 
			$sql = 'SELECT COUNT(attach_id) AS total_orphan
FROM ' . ATTACHMENTS_TABLE . '
WHERE is_orphan = 1

			$sql = 'SELECT COUNT(attach_id) AS total_orphan
FROM ' . ATTACHMENTS_TABLE . '
WHERE is_orphan = 1

Line 552Line 552
			$result = $db->sql_query($sql);
$total_orphan = (int) $db->sql_fetchfield('total_orphan');
$db->sql_freeresult($result);

			$result = $db->sql_query($sql);
$total_orphan = (int) $db->sql_fetchfield('total_orphan');
$db->sql_freeresult($result);

		}
else
{
$total_orphan = false;
}

 

$dbsize = get_database_size();



$dbsize = get_database_size();


Line 574Line 569
			'DBSIZE'			=> $dbsize,
'UPLOAD_DIR_SIZE' => $upload_dir_size,
'TOTAL_ORPHAN' => $total_orphan,

			'DBSIZE'			=> $dbsize,
'UPLOAD_DIR_SIZE' => $upload_dir_size,
'TOTAL_ORPHAN' => $total_orphan,

			'S_TOTAL_ORPHAN'	=> ($total_orphan === false) ? false : true,

 
			'GZIP_COMPRESSION'	=> ($config['gzip_compress'] && @extension_loaded('zlib')) ? $user->lang['ON'] : $user->lang['OFF'],
'DATABASE_INFO' => $db->sql_server_info(),
'PHP_VERSION_INFO' => PHP_VERSION,

			'GZIP_COMPRESSION'	=> ($config['gzip_compress'] && @extension_loaded('zlib')) ? $user->lang['ON'] : $user->lang['OFF'],
'DATABASE_INFO' => $db->sql_server_info(),
'PHP_VERSION_INFO' => PHP_VERSION,

Line 678Line 672
			}
}


			}
}


		if (!defined('PHPBB_DISABLE_CONFIG_CHECK') && file_exists($phpbb_root_path . 'config.' . $phpEx) && $phpbb_filesystem->is_writable($phpbb_root_path . 'config.' . $phpEx))

		if (!defined('PHPBB_DISABLE_CONFIG_CHECK'))

		{
// World-Writable? (000x)
$template->assign_var('S_WRITABLE_CONFIG', (bool) (@fileperms($phpbb_root_path . 'config.' . $phpEx) & 0x0002));
}

		{
// World-Writable? (000x)
$template->assign_var('S_WRITABLE_CONFIG', (bool) (@fileperms($phpbb_root_path . 'config.' . $phpEx) & 0x0002));
}

 

$this->php_ini = $phpbb_container->get('php_ini');
$func_overload = $this->php_ini->getNumeric('mbstring.func_overload');
$encoding_translation = $this->php_ini->getString('mbstring.encoding_translation');
$http_input = $this->php_ini->getString('mbstring.http_input');
$http_output = $this->php_ini->getString('mbstring.http_output');
$default_charset = $this->php_ini->getString('default_charset');


if (extension_loaded('mbstring'))
{


if (extension_loaded('mbstring'))
{

			$template->assign_vars(array(





			/**
* “mbstring.http_input” and “mbstring.http_output” are deprecated as of PHP 5.6.0
* @link https://www.php.net/manual/mbstring.configuration.php#ini.mbstring.http-input
*/
$template->assign_vars([

				'S_MBSTRING_LOADED'						=> true,

				'S_MBSTRING_LOADED'						=> true,

				'S_MBSTRING_FUNC_OVERLOAD_FAIL'			=> (intval(@ini_get('mbstring.func_overload')) & (MB_OVERLOAD_MAIL | MB_OVERLOAD_STRING)),
'S_MBSTRING_ENCODING_TRANSLATION_FAIL' => (@ini_get('mbstring.encoding_translation') != 0),
'S_MBSTRING_HTTP_INPUT_FAIL' => !in_array(@ini_get('mbstring.http_input'), array('pass', '')),
'S_MBSTRING_HTTP_OUTPUT_FAIL' => !in_array(@ini_get('mbstring.http_output'), array('pass', '')),
));


				'S_MBSTRING_FUNC_OVERLOAD_FAIL'			=> $func_overload && ($func_overload & (MB_OVERLOAD_MAIL | MB_OVERLOAD_STRING)),
'S_MBSTRING_ENCODING_TRANSLATION_FAIL' => $encoding_translation && ($encoding_translation != 0),
'S_MBSTRING_HTTP_INPUT_FAIL' => !empty($http_input),
'S_MBSTRING_HTTP_OUTPUT_FAIL' => !empty($http_output),
'S_DEFAULT_CHARSET_FAIL' => $default_charset !== null && strtolower($default_charset) !== 'utf-8',
]);

		}

// Fill dbms version if not yet filled

		}

// Fill dbms version if not yet filled