fix behaviour of HTTP/Request get

main
msquare 7 years ago
parent 86e41e2949
commit f8807c4efb

@ -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);
}
/**

@ -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'));
}
/**

Loading…
Cancel
Save