Allow empty parameter values
authorChristian Weiske <cweiske@cweiske.de>
Wed, 29 Jun 2016 19:31:21 +0000 (21:31 +0200)
committerChristian Weiske <cweiske@cweiske.de>
Wed, 29 Jun 2016 19:31:21 +0000 (21:31 +0200)
src/phancap/Options.php

index 061230c..d39af73 100644 (file)
@@ -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(