code format

This commit is contained in:
Synox 2017-01-20 23:12:08 +01:00
parent 69ae3b8d43
commit dcdafbf57c

View File

@ -97,7 +97,6 @@ function _load_one_email($mailid, $address) {
return count($emails) === 1 ? $emails[0] : null; return count($emails) === 1 ? $emails[0] : null;
} }
/** /**
* Load emails using the $mail_ids, the mails have to match the $address in TO or CC. * Load emails using the $mail_ids, the mails have to match the $address in TO or CC.
* @param $mail_ids array of integer ids * @param $mail_ids array of integer ids
@ -126,11 +125,9 @@ function _load_emails($mail_ids, $address) {
function _clean_username($username) { function _clean_username($username) {
$username = strtolower($username); $username = strtolower($username);
$username = preg_replace('/@.*$/', "", $username); // remove part after @ $username = preg_replace('/@.*$/', "", $username); // remove part after @
$username = preg_replace('/[^A-Za-z0-9_.+-]/', "", $username); // remove special characters return preg_replace('/[^A-Za-z0-9_.+-]/', "", $username); // remove special characters
return $username;
} }
/** /**
* deletes messages older than X days. * deletes messages older than X days.
*/ */
@ -144,13 +141,11 @@ function delete_old_messages() {
$mailbox->expungeDeletedMails(); $mailbox->expungeDeletedMails();
} }
// Never cache requests: // Never cache requests:
header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0"); header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
header("Cache-Control: post-check=0, pre-check=0", false); header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache"); header("Pragma: no-cache");
if (isset($_GET['username'])) { if (isset($_GET['username'])) {
// perform common validation: // perform common validation:
$username = _clean_username($_GET['username']); $username = _clean_username($_GET['username']);