From 476663284cb8af379e488608e2fd7a6d78761a9d Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Wed, 29 Jun 2016 21:31:21 +0200 Subject: [PATCH] Allow empty parameter values --- src/phancap/Options.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/phancap/Options.php b/src/phancap/Options.php index 061230c..d39af73 100644 --- a/src/phancap/Options.php +++ b/src/phancap/Options.php @@ -144,7 +144,11 @@ class Options continue; } - if ($arOption['type'] == 'url') { + if ($arValues[$name] === '' + && !isset($arOption['required']) + ) { + //allow empty value; default value will be used + } else if ($arOption['type'] == 'url') { $this->values[$name] = $this->validateUrl($arValues[$name]); } else if ($arOption['type'] == 'int') { $this->values[$name] = $this->validateInt( -- 2.30.2