diff --git a/README.md b/README.md index f603daf..a0a028d 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,13 @@ A **self-hosted** disposable mailbox service (aka trash mail) :cloud: :envelop * Automatic refresh. Download and delete your emails. * Display emails as text or html with sanitization filter. * Display emails based on one [catch-all imap mailbox](https://www.google.ch/search?q=how+to+setup+catch-all+imap+mailbox). -* Only requires PHP >=5.3.0 and [imap extension](http://php.net/manual/book.imap.php) +* Only requires PHP >=7.2 and [imap extension](http://php.net/manual/book.imap.php) ## Usage ### Requirements -* webserver with php >=5.3.0 +* webserver with php >=7.2 * php [imap extension](http://php.net/manual/book.imap.php) * IMAP account and a domain with [catch-all configuration](https://www.google.ch/search?q=how+to+setup+catch-all+imap+mailbox). (all emails go to one mailbox). diff --git a/src/pages.php b/src/pages.php index 425228c..842cec2 100644 --- a/src/pages.php +++ b/src/pages.php @@ -18,7 +18,6 @@ class RedirectToAddressPage extends Page { function invoke() { $user = User::parseUsernameAndDomain($this->username, $this->domain); header("location: ?" . $user->username . "@" . $user->domain); - exit(); } } @@ -40,10 +39,9 @@ class DownloadEmailPage extends Page { $download_email_id = filter_var($this->email_id, FILTER_SANITIZE_NUMBER_INT); if ($user->isInvalid()) { redirect_to_random($this->config_domains); - exit(); + } else { + download_email($download_email_id, $user); } - download_email($download_email_id, $user); - exit(); } } @@ -64,11 +62,10 @@ class DeleteEmailPage extends Page { $delete_email_id = filter_var($this->email_id, FILTER_SANITIZE_NUMBER_INT); if ($user->isInvalid()) { redirect_to_random($this->all_domains); - exit(); + } else { + delete_email($delete_email_id, $user); + header("location: ?" . $user->address); } - delete_email($delete_email_id, $user); - header("location: ?" . $user->address); - exit(); } } @@ -81,7 +78,6 @@ class RedirectToRandomAddressPage extends Page { function invoke() { redirect_to_random($this->all_domains); - exit(); } } @@ -101,13 +97,12 @@ class DisplayEmailsPage extends Page { $user = User::parseDomain($this->address); if ($user->isInvalid()) { redirect_to_random($this->config['domains']); - exit(); + } else { + global $emails; + global $config; + $emails = get_emails($user); + require "frontend.template.php"; } - global $emails; - global $config; - $emails = get_emails($user); - require "frontend.template.php"; - } }