mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
Allow smtp response to be handled more efficiently by Socket class.
Parse test for smtp response checks more accurately at the beginning of the response. Fixes #5062. git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7461 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
0b5fbe04f6
commit
fe62d7f70d
1 changed files with 2 additions and 10 deletions
|
@ -750,17 +750,9 @@ class EmailComponent extends Object{
|
||||||
$this->__smtpConnection->write($data . "\r\n");
|
$this->__smtpConnection->write($data . "\r\n");
|
||||||
}
|
}
|
||||||
if ($checkCode !== false) {
|
if ($checkCode !== false) {
|
||||||
$response = '';
|
$response = $this->__smtpConnection->read();
|
||||||
|
|
||||||
while ($str = $this->__smtpConnection->read()) {
|
if (!preg_match('/^' . $checkCode . '/', $response)) {
|
||||||
$response .= $str;
|
|
||||||
|
|
||||||
if ($str[3] == ' ') {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (stristr($response, $checkCode) === false) {
|
|
||||||
$this->smtpError = $response;
|
$this->smtpError = $response;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue