Permalink
Browse files

ConsoleOptionParser::_parseOption() tramples option values of 0 (zero…

…). I believe the following condition is the culprit.
  • Loading branch information...
1 parent 6292fc7 commit 80773ad970dc2a2ba4ea0abffb9540736a787c57 @sime sime committed Dec 10, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/Cake/Console/ConsoleOptionParser.php
@@ -585,7 +585,8 @@ protected function _parseOption($name, $params) {
$option = $this->_options[$name];
$isBoolean = $option->isBoolean();
$nextValue = $this->_nextToken();
- if (!$isBoolean && !empty($nextValue) && !$this->_optionExists($nextValue)) {
+ $emptyNextValue = (empty($nextValue) && $nextValue != 0);
+ if (!$isBoolean && !$emptyNextValue && !$this->_optionExists($nextValue)) {
array_shift($this->_tokens);
$value = $nextValue;
} elseif ($isBoolean) {

0 comments on commit 80773ad

Please sign in to comment.