From 67ac2f2f9a3c925f04040c5672aa54a74703e01b Mon Sep 17 00:00:00 2001 From: Jesse O'Brien Date: Wed, 6 Jun 2012 15:10:06 -0400 Subject: [PATCH] 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. --- laravel/request.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/laravel/request.php b/laravel/request.php index 510f64eb..84763449 100644 --- a/laravel/request.php +++ b/laravel/request.php @@ -102,7 +102,8 @@ class Request { */ 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; } /**