summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Http/Request.php4
-rw-r--r--tests/Unit/Http/RequestTest.php3
2 files changed, 4 insertions, 3 deletions
diff --git a/src/Http/Request.php b/src/Http/Request.php
index e7850c8b..585fb5e9 100644
--- a/src/Http/Request.php
+++ b/src/Http/Request.php
@@ -38,9 +38,9 @@ class Request extends SymfonyRequest
*/
public function has($key)
{
- $value = $this->input($key);
+ $value = $this->input($key, null);
- return !empty($value);
+ return !($value === null);
}
/**
diff --git a/tests/Unit/Http/RequestTest.php b/tests/Unit/Http/RequestTest.php
index 3f317367..a68f8b8f 100644
--- a/tests/Unit/Http/RequestTest.php
+++ b/tests/Unit/Http/RequestTest.php
@@ -47,7 +47,8 @@ class RequestTest extends TestCase
]);
$this->assertTrue($request->has('foo'));
- $this->assertFalse($request->has('bar'));
+ $this->assertTrue($request->has('bar'));
+ $this->assertFalse($request->has('baz'));
}
/**