Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/origin/master' into 5.2-stable
Browse files Browse the repository at this point in the history
  • Loading branch information
Synchro committed Apr 13, 2017
2 parents 42c7591 + 6525e86 commit 21f1f3f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# ChangeLog

* Handle bare codes (an RFC contravention) in SMTP server responses

## Version 5.2.23 (March 15th 2017)
* Improve trapping of TLS errors during connection so that they don't cause warnings, and are reported better in debug output
* Amend test suite so it uses PHPUnit version 4.8, compatible with older versions of PHP, instead of teh version supplied by Travis-CI
Expand Down
6 changes: 4 additions & 2 deletions class.smtp.php
Original file line number Diff line number Diff line change
Expand Up @@ -1089,8 +1089,10 @@ protected function get_lines()
$this->edebug("SMTP -> get_lines(): \$data is \"$data\"", self::DEBUG_LOWLEVEL);
$this->edebug("SMTP -> get_lines(): \$str is \"$str\"", self::DEBUG_LOWLEVEL);
$data .= $str;
// If 4th character is a space, we are done reading, break the loop, micro-optimisation over strlen
if ((isset($str[3]) and $str[3] == ' ')) {
// If response is only 3 chars (not valid, but RFC5321 S4.2 says it must be handled),
// or 4th character is a space, we are done reading, break the loop,
// string array access is a micro-optimisation over strlen
if (!isset($str[3]) or (isset($str[3]) and $str[3] == ' ')) {
break;
}
// Timed-out? Log and break
Expand Down

0 comments on commit 21f1f3f

Please sign in to comment.