Created
March 3, 2014 10:45
-
-
Save Tocacar/9322525 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if (!in_array(@$_SERVER['REMOTE_ADDR'], array( | |
'127.0.0.1', | |
'::1', | |
))) { | |
header('HTTP/1.0 403 Forbidden'); | |
exit('You are not allowed to access this file.'); | |
} | |
opcache_reset(); | |
?> |
akrabat
commented
Mar 3, 2014
<?php
if (!isset($_SERVER['REMOTE_ADDR']) || !in_array($_SERVER['REMOTE_ADDR'], array(
'127.0.0.1',
'::1',
)
)) {
header('HTTP/1.0 403 Forbidden');
exit('You are not allowed to access this file.');
}
opcache_reset();
Else people would get access when they don't have a IP address at all :-)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment