*
* Question: Do we really need these three methods?
*/
- if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE'])) {
+ if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) && isset($_SERVER['HTTP_IF_NONE_MATCH'])) {
header('HTTP/1.1 304 Not Modified');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s', time()) . ' GMT');
header('Etag: ' . $_SERVER['HTTP_IF_NONE_MATCH']);
$user = DBA::selectFirst('user', ['prvkey'], ['uid' => $uid]);
$condition = ["`uid` = ? AND `server` != ''", $uid];
- $mailacct = DBA::selectFirst('mailacct', ['pass', 'user'], $condition);
+ $fields = ['pass', 'user', 'server', 'port', 'ssltype', 'mailbox'];
+ $mailacct = DBA::selectFirst('mailacct', $fields, $condition);
if (!DBA::isResult($user) || !DBA::isResult($mailacct)) {
return false;
public static function isUrlBlocked($url)
{
$host = @parse_url($url, PHP_URL_HOST);
- if (! $host) {
- return true;
+ if (!$host) {
+ return false;
}
$domain_blocklist = Config::get('system', 'blocklist', []);
- if (! $domain_blocklist) {
+ if (!$domain_blocklist) {
return false;
}