Page MenuHomePhabricator

D11138.diff
No OneTemporary

D11138.diff

diff --git a/src/parser/argument/PhutilArgumentParser.php b/src/parser/argument/PhutilArgumentParser.php
--- a/src/parser/argument/PhutilArgumentParser.php
+++ b/src/parser/argument/PhutilArgumentParser.php
@@ -124,7 +124,9 @@
for ($ii = 0; $ii < $len; $ii++) {
$arg = $argv[$ii];
$map = null;
- if ($arg == '--') {
+ if (!is_string($arg)) {
+ // Non-string argument; pass it through as-is.
+ } else if ($arg == '--') {
// This indicates "end of flags".
break;
} else if ($arg == '-') {
@@ -660,7 +662,11 @@
if ($value == '--') {
unset($argv[$key]);
break;
- } else if (!strncmp($value, '-', 1) && strlen($value) > 1) {
+ } else if (
+ is_string($value) &&
+ !strncmp($value, '-', 1) &&
+ strlen($value) > 1) {
+
throw new PhutilArgumentUsageException(
"Argument '{$value}' is unrecognized. Use '--' to indicate the ".
"end of flags.");

File Metadata

Mime Type
text/plain
Expires
Thu, Nov 28, 9:35 PM (22 h, 51 s)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6802380
Default Alt Text
D11138.diff (991 B)

Event Timeline