Skip to content
Browse files

Merge pull request #36 from GromNaN/patch-1

Remove IP control if no IP is defined.

Thanks for the great work! I think this helps balance default security, with the large number of installs like yours where they need everyone to have access.
  • Loading branch information...
2 parents 33bf640 + 3773ad0 commit c16ee32a9e435f938fab9b44d525bc039c6eff84 @preinheimer committed Apr 8, 2012
Showing with 4 additions and 3 deletions.
  1. +1 −1 xhprof_html/callgraph.php
  2. +1 −1 xhprof_html/index.php
  3. +2 −1 xhprof_lib/config.sample.php
View
2 xhprof_html/callgraph.php
@@ -30,7 +30,7 @@
*/
require_once ("../xhprof_lib/config.php");
-if (!in_array($_SERVER['REMOTE_ADDR'], $controlIPs))
+if (false !== $controlIPs && !in_array($_SERVER['REMOTE_ADDR'], $controlIPs))
{
die("You do not have permission to view this page.");
}
View
2 xhprof_html/index.php
@@ -6,7 +6,7 @@
include_once XHPROF_LIB_ROOT . '/display/xhprof.php';
include (XHPROF_LIB_ROOT . "/utils/common.php");
-if (!in_array($_SERVER['REMOTE_ADDR'], $controlIPs))
+if (false !== $controlIPs && !in_array($_SERVER['REMOTE_ADDR'], $controlIPs))
{
die("You do not have permission to view this page.");
}
View
3 xhprof_lib/config.sample.php
@@ -45,7 +45,8 @@
$_xhprof['doprofile'] = false;
$controlIPs = array();
-$controlIPs[] = "127.0.0.1"; //Localhost, you'll want to add your own ip here
+$controlIPs[] = "127.0.0.1"; // localhost, you'll want to add your own ip here
+$controlIPs[] = "::1"; // localhost IP v6
//$otherURLS = array();

0 comments on commit c16ee32

Please sign in to comment.
Something went wrong with that request. Please try again.