Browse Source

Simplify how options are checked.

mark_story 14 years ago
parent
commit
5e495ad90c
1 changed files with 6 additions and 1 deletions
  1. 6 1
      lib/Cake/Console/Shell.php

+ 6 - 1
lib/Cake/Console/Shell.php

@@ -465,7 +465,12 @@ class Shell extends Object {
 			}
 		}
 		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);
 			}
 		}