You appear to be a bot. Output may be restricted
Description
Determines if this is a local IPIf the URL is the same as the server then it's a local request. If the IP for the URL is 127.0.0.1 then it's local.
Usage
$bool = oik_remote::are_you_local_IP( $url );
Parameters
- $url
- ( string ) required – e.g. https://qw/wordpress
Returns
bool true if a local IPTO DO
Determine whether or not to test for just 127.Source
File name: oik/libs/class-oik-remote.phpLines:
1 to 13 of 13
static function are_you_local_IP( $url ) { if ( !isset( $_SERVER['SERVER_NAME']) ) { return false; } $local_host = $_SERVER['SERVER_NAME']; $remote_host = parse_url( $url, PHP_URL_HOST ); $local = ( $local_host == $remote_host ); if ( !$local ) { $remote_ip = gethostbyname( $remote_host ); $local = $remote_ip === "127.0.0.1"; } return $local; }View on GitHub View on Trac