Check for localhost supports also IPv6 loopback address

This commit is contained in:
silvanm
2011-01-25 13:39:42 +01:00
committed by Jordi Boggiano
parent 6b23baa79f
commit 788a70cad3
+2 -2
View File
@@ -18,7 +18,7 @@ $options = array(
* *
* Source on Github http://github.com/Seldaek/php-console * 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'); header('HTTP/1.1 401 Access unauthorized');
die('ERR/401 Go Away'); die('ERR/401 Go Away');
} }
@@ -108,4 +108,4 @@ if (isset($_POST['code'])) {
php-console v<?php echo PHP_CONSOLE_VERSION ?> - by <a href="http://seld.be/">Jordi Boggiano</a> - <a href="http://github.com/Seldaek/php-console">sources on github</a> php-console v<?php echo PHP_CONSOLE_VERSION ?> - by <a href="http://seld.be/">Jordi Boggiano</a> - <a href="http://github.com/Seldaek/php-console">sources on github</a>
</div> </div>
</body> </body>
</html> </html>