mirror of
https://github.com/retailcrm/Fetch.git
synced 2024-11-25 04:26:02 +03:00
Fix an issue where the IMAP stream isn't reloaded after it's lost.
If $this->imapStream is lost, it will return 0. These conditionals evalute 0 as a set variable, therefore they don't reload the stream even though they should.
This commit is contained in:
parent
b5b790ea75
commit
f0b6c14632
@ -250,7 +250,7 @@ class Server
|
|||||||
*/
|
*/
|
||||||
public function getImapStream()
|
public function getImapStream()
|
||||||
{
|
{
|
||||||
if (!isset($this->imapStream))
|
if (empty($this->imapStream))
|
||||||
$this->setImapStream();
|
$this->setImapStream();
|
||||||
|
|
||||||
return $this->imapStream;
|
return $this->imapStream;
|
||||||
@ -302,7 +302,7 @@ class Server
|
|||||||
*/
|
*/
|
||||||
protected function setImapStream()
|
protected function setImapStream()
|
||||||
{
|
{
|
||||||
if (isset($this->imapStream)) {
|
if (!empty($this->imapStream)) {
|
||||||
if (!imap_reopen($this->imapStream, $this->getServerString(), $this->options, 1))
|
if (!imap_reopen($this->imapStream, $this->getServerString(), $this->options, 1))
|
||||||
throw new \RuntimeException(imap_last_error());
|
throw new \RuntimeException(imap_last_error());
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user