Commit 6a6ca995 authored by Eric Windham's avatar Eric Windham

Merge branch 'issue#3765' into 'develop'

Added sanity check to confirm we have a valid IP address before sending to dispatch.

Closes #3765

See merge request ninja-forms/ninja-forms!3709
parents ae789c14 097e944f
......@@ -65,7 +65,13 @@ final class NF_Dispatcher
$ip_address = $_SERVER[ 'LOCAL_ADDR' ];
}
$host_name = gethostbyaddr( $ip_address );
// If we have a valid IP Address...
if ( filter_var( $ip_address, FILTER_VALIDATE_IP ) ) {
// Get the hostname.
$host_name = gethostbyaddr( $ip_address );
} else {
$host_name = 'unknown';
}
if ( is_multisite() ) {
$multisite_enabled = 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment