-
Notifications
You must be signed in to change notification settings - Fork 111
Check that $token[0] exists before trying to use it. #37
Check that $token[0] exists before trying to use it. #37
Conversation
$tokens[] = $matches[1]; | ||
$line = substr($line, strlen($matches[0])); | ||
continue; | ||
if (isset($token[0])) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change this as '! isset(){continue}'
need to first check that $token[0] exists before trying to use it.
2daab4d
to
3e94c5b
Compare
All set, let me know if you need any other changes made. |
@Maks3w @weierophinney do you have any concerns with merging this? I have a few more PRs to write, but want to make sure the path is clear to do so. |
Need tests |
@Maks3w current tests cover this code path, so I think it's fine test-wise. |
If existing test cover this then this PR its not needed as those tests detect the failure and its fixed. |
I'm not quite sure how to go about this since we're checking a server response. I ran tests against a real Courier IMAP server, so if |
Check that $token[0] exists before trying to use it.
With Courier IMAP, you will get an error when checking for $token[0] for some responses, so we ensure that it exists first.