From 788a70cad3fc3be8a7feea16d83f5f32f072dde9 Mon Sep 17 00:00:00 2001 From: silvanm Date: Tue, 25 Jan 2011 13:31:30 +0100 Subject: [PATCH] Check for localhost supports also IPv6 loopback address --- index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.php b/index.php index 83453ee..841dc31 100644 --- a/index.php +++ b/index.php @@ -18,7 +18,7 @@ $options = array( * * Source on Github http://github.com/Seldaek/php-console */ -if ($_SERVER['REMOTE_ADDR'] != '127.0.0.1') { +if (!in_array($_SERVER['REMOTE_ADDR'], array('127.0.0.1', '::1'), true)) { header('HTTP/1.1 401 Access unauthorized'); die('ERR/401 Go Away'); } @@ -108,4 +108,4 @@ if (isset($_POST['code'])) { php-console v - by Jordi Boggiano - sources on github - \ No newline at end of file +