phpBB

Code Changes

File: includes/acp/acp_php_info.php

  Unmodified   Added   Modified   Removed
Line 37Line 37
		$this->page_title = 'ACP_PHP_INFO';

ob_start();

		$this->page_title = 'ACP_PHP_INFO';

ob_start();

		@phpinfo(INFO_GENERAL | INFO_CONFIGURATION | INFO_MODULES | INFO_VARIABLES);

		phpinfo(INFO_GENERAL | INFO_CONFIGURATION | INFO_MODULES | INFO_VARIABLES);

		$phpinfo = ob_get_clean();

$phpinfo = trim($phpinfo);

		$phpinfo = ob_get_clean();

$phpinfo = trim($phpinfo);

Line 47Line 47
		// for this was nabbed from the PHP annotated manual
preg_match_all('#<body[^>]*>(.*)</body>#si', $phpinfo, $output);


		// for this was nabbed from the PHP annotated manual
preg_match_all('#<body[^>]*>(.*)</body>#si', $phpinfo, $output);


		if (empty($phpinfo) || empty($output))

		if (empty($phpinfo) || empty($output[1][0]))

		{
trigger_error('NO_PHPINFO_AVAILABLE', E_USER_WARNING);
}

		{
trigger_error('NO_PHPINFO_AVAILABLE', E_USER_WARNING);
}

Line 66Line 66
		$output = preg_replace('#<table[^>]+>#i', '<table>', $output);
$output = preg_replace('#<img border="0"#i', '<img', $output);
$output = str_replace(array('class="e"', 'class="v"', 'class="h"', '<hr />', '<font', '</font>'), array('class="row1"', 'class="row2"', '', '', '<span', '</span>'), $output);

		$output = preg_replace('#<table[^>]+>#i', '<table>', $output);
$output = preg_replace('#<img border="0"#i', '<img', $output);
$output = str_replace(array('class="e"', 'class="v"', 'class="h"', '<hr />', '<font', '</font>'), array('class="row1"', 'class="row2"', '', '', '<span', '</span>'), $output);

 

// Fix invalid anchor names (eg "module_Zend Optimizer")
$output = preg_replace_callback('#<a name="([^"]+)">#', array($this, 'remove_spaces'), $output);


if (empty($output))
{


if (empty($output))
{

Line 78Line 81
		$output = (!empty($output[1][0])) ? $output[1][0] : $orig_output;

$template->assign_var('PHPINFO', $output);

		$output = (!empty($output[1][0])) ? $output[1][0] : $orig_output;

$template->assign_var('PHPINFO', $output);

 
	}

function remove_spaces($matches)
{
return '<a name="' . str_replace(' ', '_', $matches[1]) . '">';

	}
}


	}
}