From 381ebcf195499c2656b7fc3e49b14a665320ba4b Mon Sep 17 00:00:00 2001 From: Callum Macrae Date: Mon, 11 Jul 2011 15:17:46 +0100 Subject: [ticket/9645] Added code to repair invalid anchor names in acp_php_info. Some of the anchor tags produced by php_info had names like "module_Zend Optimizer", which is obviously invalid. This commit adds some code that repairs the names by replacing all spaces found in the names with underscores. PHPBB3-9645 --- phpBB/includes/acp/acp_php_info.php | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'phpBB/includes/acp/acp_php_info.php') diff --git a/phpBB/includes/acp/acp_php_info.php b/phpBB/includes/acp/acp_php_info.php index 0499095004..7dd345971a 100644 --- a/phpBB/includes/acp/acp_php_info.php +++ b/phpBB/includes/acp/acp_php_info.php @@ -67,6 +67,9 @@ class acp_php_info $output = preg_replace('#', ''), array('class="row1"', 'class="row2"', '', '', ''), $output); + // Fix invalid anchor names (eg "module_Zend Optimizer") + $output = preg_replace_callback('##', array($this, 'remove_spaces'), $output); + if (empty($output)) { trigger_error('NO_PHPINFO_AVAILABLE', E_USER_WARNING); @@ -79,6 +82,11 @@ class acp_php_info $template->assign_var('PHPINFO', $output); } + + function remove_spaces($matches) + { + return ''; + } } ?> \ No newline at end of file -- cgit v1.2.1