From d86291abf8e12a776c505fffe1753d4c9d822efe Mon Sep 17 00:00:00 2001 From: flashwave Date: Mon, 18 Mar 2019 21:03:12 +0100 Subject: [PATCH] Fixed gigantic oversight. --- src/Request/RequestVar.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Request/RequestVar.php b/src/Request/RequestVar.php index a30ecd14..c1e3e1f2 100644 --- a/src/Request/RequestVar.php +++ b/src/Request/RequestVar.php @@ -85,7 +85,7 @@ class RequestVar public function string(?string $default = null): ?string { - return mb_scrub(preg_replace('/[\x00-\x09\x0B-\x0C\x0D-\x1F\x7F]/u', '', (string)$this->value)); + return empty($this->value) ? $default : mb_scrub(preg_replace('/[\x00-\x09\x0B-\x0C\x0D-\x1F\x7F]/u', '', (string)$this->value)); } public function int(?int $default = null): ?int