diff --git a/imap.php b/imap.php index ed55a4a..0a7e351 100644 --- a/imap.php +++ b/imap.php @@ -44,7 +44,7 @@ class imap if ($password === null) throw new Exception ("No password provided for IMAP server", 500); $imapssl = ($imapssl !== false) ? "/ssl" : ""; - $imapcertvalidate = ($imapcertvalidate !== false) ? "/novalidate-cert" : ""; + $imapcertvalidate = ($imapcertvalidate === false) ? "/novalidate-cert" : ""; $this->mailbox = "{"."$imapserver:$imapport/imap$imapssl$imapcertvalidate". "/user=$username}"; if (! array_key_exists ($this->mailbox, self::$instance)) @@ -174,6 +174,7 @@ class imap $res = array_map (function ($folder) { return mb_convert_encoding ($folder, "UTF-8", "UTF7-IMAP"); }, $res); + natsort ($res); return $res; }