From: Christian Weiske Date: Thu, 1 Feb 2018 10:12:31 +0000 (+0100) Subject: Handle space after "-x" option. X-Git-Tag: v0.7.0~4 X-Git-Url: https://git.cweiske.de/shpub.git/commitdiff_plain/afec87fc377ef8bafec4b7588084cca91468bd68?hp=0a7989a9eb92e3cc3ea06dee5964f91b677ac920 Handle space after "-x" option. Normally you do "-xfoo=bar", but some people try to do "-x foo=bar" which caused strange issues. Resolves: https://github.com/cweiske/shpub/issues/11 --- diff --git a/src/shpub/Command/AbstractProps.php b/src/shpub/Command/AbstractProps.php index e186819..c893eef 100644 --- a/src/shpub/Command/AbstractProps.php +++ b/src/shpub/Command/AbstractProps.php @@ -188,6 +188,10 @@ class Command_AbstractProps if (count($cmdRes->options['x'])) { $postParams = []; foreach ($cmdRes->options['x'] as $xproperty) { + if ($xproperty == '') { + //happens with "-x foo=bar" instead of "-xfoo=bar" + continue; + } list($propkey, $propval) = explode('=', $xproperty, 2); if (!isset($postParams[$propkey])) { $postParams[$propkey] = [];