Skip to content

Commit

Permalink
Simplify how options are checked.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Jan 18, 2012
1 parent e080bb2 commit 5e495ad
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/Cake/Console/Shell.php
Expand Up @@ -465,7 +465,12 @@ public function in($prompt, $options = null, $default = null) {
}
}
if (is_array($options)) {
while ($in === '' || !(in_array(strtolower($in), $options) || in_array(strtoupper($in), $options) || in_array($in, $options))) {
$options = array_merge(
array_map('strtolower', $options),
array_map('strtoupper', $options),
$options
);
while ($in === '' || !in_array($in, $options)) {
$in = $this->_getInput($prompt, $options, $default);
}
}
Expand Down

0 comments on commit 5e495ad

Please sign in to comment.