require php 7
This commit is contained in:
parent
4775a190b0
commit
ee18dd0581
|
@ -14,13 +14,13 @@ A **self-hosted** disposable mailbox service (aka trash mail) :cloud: :envelop
|
||||||
* Automatic refresh. Download and delete your emails.
|
* Automatic refresh. Download and delete your emails.
|
||||||
* Display emails as text or html with sanitization filter.
|
* 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).
|
* 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
|
## Usage
|
||||||
|
|
||||||
### Requirements
|
### Requirements
|
||||||
|
|
||||||
* webserver with php >=5.3.0
|
* webserver with php >=7.2
|
||||||
* php [imap extension](http://php.net/manual/book.imap.php)
|
* 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).
|
* 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).
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,6 @@ class RedirectToAddressPage extends Page {
|
||||||
function invoke() {
|
function invoke() {
|
||||||
$user = User::parseUsernameAndDomain($this->username, $this->domain);
|
$user = User::parseUsernameAndDomain($this->username, $this->domain);
|
||||||
header("location: ?" . $user->username . "@" . $user->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);
|
$download_email_id = filter_var($this->email_id, FILTER_SANITIZE_NUMBER_INT);
|
||||||
if ($user->isInvalid()) {
|
if ($user->isInvalid()) {
|
||||||
redirect_to_random($this->config_domains);
|
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);
|
$delete_email_id = filter_var($this->email_id, FILTER_SANITIZE_NUMBER_INT);
|
||||||
if ($user->isInvalid()) {
|
if ($user->isInvalid()) {
|
||||||
redirect_to_random($this->all_domains);
|
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() {
|
function invoke() {
|
||||||
redirect_to_random($this->all_domains);
|
redirect_to_random($this->all_domains);
|
||||||
exit();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -101,13 +97,12 @@ class DisplayEmailsPage extends Page {
|
||||||
$user = User::parseDomain($this->address);
|
$user = User::parseDomain($this->address);
|
||||||
if ($user->isInvalid()) {
|
if ($user->isInvalid()) {
|
||||||
redirect_to_random($this->config['domains']);
|
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";
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user