From 63e393bdd072dfcecebbe0116cfd5716f6b9d179 Mon Sep 17 00:00:00 2001 From: Cameron Date: Thu, 28 Feb 2013 14:27:01 -0800 Subject: [PATCH] Php Info styling --- e107_admin/phpinfo.php | 41 +++++++++++++++++++++++++++++++++++++---- 1 file changed, 37 insertions(+), 4 deletions(-) diff --git a/e107_admin/phpinfo.php b/e107_admin/phpinfo.php index ffa4d99a9..504790755 100644 --- a/e107_admin/phpinfo.php +++ b/e107_admin/phpinfo.php @@ -16,17 +16,50 @@ require_once("../class2.php"); if (!getperms("0")) { - header("location:".e_BASE."index.php"); - exit; + header("location:".e_BASE."index.php"); + exit; } $e_sub_cat = 'phpinfo'; require_once("auth.php"); - + ob_start(); phpinfo(); $phpinfo .= ob_get_contents(); $phpinfo = preg_replace("#^.*#is", "", $phpinfo); +$phpinfo = str_replace("font","span",$phpinfo); +$phpinfo = str_replace("","",$phpinfo); +$phpinfo = str_replace('border="0"','',$phpinfo); +$phpinfo = str_replace(' 'If you have Curl enabled, you should consider disabling this feature.', + "allow_url_include" => 'This is a security risk and is not needed by e107.', + "display_errors" => 'On a production server, it is better to disable the displaying of errors in the browser.', + "expose_php" => 'Disabling this will hide your PHP version from browsers.', + "register_globals" => 'This is a security risk and should be disabled.' + ); + + foreach($security_risks as $risk=>$diz) + { + if(ini_get($risk)) + { + $srch = '
'.$risk.''; + $repl = '
'.$risk.''; + $phpinfo = str_replace($srch,$repl,$phpinfo); + $mes->addWarning("".$risk.": ".$diz); + } + } + + +// $phpinfo = preg_replace("#^.*#is", "", $phpinfo); ob_end_clean(); -$ns->tablerender("PHPInfo", $phpinfo); +$ns->tablerender("PHPInfo", $mes->render(). $phpinfo); require_once("footer.php"); ?> \ No newline at end of file