bug #11169 [Console] Fixed notice in DialogHelper (florianv)

This PR was merged into the 2.3 branch.

Discussion
----------

[Console] Fixed notice in DialogHelper

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| License       | MIT

When pressing escape in a question, a notice is shown because the sequence is only 2 characters long.

Commits
-------

ff6c65e [Console] Fixed notice in DialogHelper
This commit is contained in:
Fabien Potencier 2014-06-19 11:31:20 +02:00
commit 7d4f4f276a
1 changed files with 1 additions and 1 deletions

View File

@ -150,7 +150,7 @@ class DialogHelper extends Helper
$c .= fread($inputStream, 2);
// A = Up Arrow. B = Down Arrow
if ('A' === $c[2] || 'B' === $c[2]) {
if (isset($c[2]) && ('A' === $c[2] || 'B' === $c[2])) {
if ('A' === $c[2] && -1 === $ofs) {
$ofs = 0;
}