Mailbox update
This commit is contained in:
@@ -8,7 +8,6 @@ class Emailinbox extends Renderer {
|
|||||||
public function __construct(?string $templateName = null) {
|
public function __construct(?string $templateName = null) {
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
$folder = utf8_encode(urldecode(filter_input(INPUT_GET, 'folder'))) ?? 'INBOX';
|
$folder = utf8_encode(urldecode(filter_input(INPUT_GET, 'folder'))) ?? 'INBOX';
|
||||||
var_dump($folder);
|
|
||||||
if (!$this->connectToImap($folder)) {
|
if (!$this->connectToImap($folder)) {
|
||||||
$this->templateName = 'imaperror';
|
$this->templateName = 'imaperror';
|
||||||
}
|
}
|
||||||
@@ -23,6 +22,9 @@ class Emailinbox extends Renderer {
|
|||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
$headers = $this->mbox->getMailsInfo($mailsIds);
|
$headers = $this->mbox->getMailsInfo($mailsIds);
|
||||||
|
if (!$headers) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
foreach ($headers as $header) {
|
foreach ($headers as $header) {
|
||||||
try {
|
try {
|
||||||
$date = \DateTime::createFromFormat('D, d M Y H:i:s O', str_replace([' (CET)', ' (CEST)', ' (UTC)'], '' , $header->date));
|
$date = \DateTime::createFromFormat('D, d M Y H:i:s O', str_replace([' (CET)', ' (CEST)', ' (UTC)'], '' , $header->date));
|
||||||
|
|||||||
Reference in New Issue
Block a user