imap : if the content is empty, the mail is not found
git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@5824 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
6
imap.php
6
imap.php
@@ -472,7 +472,7 @@ class imap
|
|||||||
$content = @imap_fetchheader (self::$instance[$this->mailbox], $msgno)."\n".
|
$content = @imap_fetchheader (self::$instance[$this->mailbox], $msgno)."\n".
|
||||||
@imap_body (self::$instance[$this->mailbox], $msgno);
|
@imap_body (self::$instance[$this->mailbox], $msgno);
|
||||||
$errors = imap_errors ();
|
$errors = imap_errors ();
|
||||||
if ($errors !== false)
|
if ($errors !== false || $content === "\n")
|
||||||
throw new \Exception ("Mail not found", 404);
|
throw new \Exception ("Mail not found", 404);
|
||||||
return $content;
|
return $content;
|
||||||
}
|
}
|
||||||
@@ -489,7 +489,7 @@ class imap
|
|||||||
imap_errors();
|
imap_errors();
|
||||||
$content = @imap_fetchheader (self::$instance[$this->mailbox], $msgno);
|
$content = @imap_fetchheader (self::$instance[$this->mailbox], $msgno);
|
||||||
$errors = imap_errors ();
|
$errors = imap_errors ();
|
||||||
if ($errors !== false)
|
if ($errors !== false || $content === "")
|
||||||
throw new \Exception ("Mail not found", 404);
|
throw new \Exception ("Mail not found", 404);
|
||||||
return $content;
|
return $content;
|
||||||
}
|
}
|
||||||
@@ -506,7 +506,7 @@ class imap
|
|||||||
imap_errors();
|
imap_errors();
|
||||||
$content = @imap_body (self::$instance[$this->mailbox], $msgno);
|
$content = @imap_body (self::$instance[$this->mailbox], $msgno);
|
||||||
$errors = imap_errors ();
|
$errors = imap_errors ();
|
||||||
if ($errors !== false)
|
if ($errors !== false || $content === "")
|
||||||
throw new \Exception ("Mail not found", 404);
|
throw new \Exception ("Mail not found", 404);
|
||||||
return $content;
|
return $content;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user