Merge remote-tracking branch 'callumacrae/ticket/9645' into develop-olympus

* callumacrae/ticket/9645:
  [ticket/9645] Added code to repair invalid anchor names in acp_php_info.
This commit is contained in:
Oleg Pudeyev 2011-07-30 18:47:54 -04:00
commit 5653be8e16

View file

@ -67,6 +67,9 @@ class acp_php_info
$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))
{
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 '<a name="' . str_replace(' ', '_', $matches[1]) . '">';
}
}
?>