Default was never returned. If no IP was found it returns NULL.
While unit testing I found that providing a default IP address to Request::ip() returns NULL in a CLI environment.
This commit is contained in:
parent
d9802fe656
commit
67ac2f2f9a
|
@ -102,7 +102,8 @@ public static function spoofed()
|
||||||
*/
|
*/
|
||||||
public static function ip($default = '0.0.0.0')
|
public static function ip($default = '0.0.0.0')
|
||||||
{
|
{
|
||||||
return value(static::foundation()->getClientIp(), $default);
|
$client_ip = static::foundation()->getClientIp();
|
||||||
|
return $client_ip === NULL ? $default : $client_ip;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue