[SOGo, Dovecot] Remove unnecessary likes from sql queries

[Web] Filter transport destinations to prevent empty destinations
master
andryyy 2020-09-20 22:21:00 +02:00
parent 4627331339
commit 3a9efc86cf
No known key found for this signature in database
GPG Key ID: 8EC34FF2794E25EF
2 changed files with 2 additions and 2 deletions

View File

@ -35,7 +35,7 @@ SELECT
mailbox.username, mailbox.username,
mailbox.domain, mailbox.domain,
mailbox.username, mailbox.username,
if(json_extract(attributes, '$.force_pw_update') LIKE '%0%', if(json_extract(attributes, '$.sogo_access') LIKE '%1%', password, '{SSHA256}A123A123A321A321A321B321B321B123B123B321B432F123E321123123321321'), '{SSHA256}A123A123A321A321A321B321B321B123B123B321B432F123E321123123321321'), IF(JSON_UNQUOTE(JSON_VALUE(attributes, '$.force_pw_update')) = '0', IF(JSON_UNQUOTE(JSON_VALUE(attributes, '$.sogo_access')) = 1, password, '{SSHA256}A123A123A321A321A321B321B321B123B123B321B432F123E321123123321321'), '{SSHA256}A123A123A321A321A321B321B321B123B123B321B432F123E321123123321321'),
mailbox.name, mailbox.name,
mailbox.username, mailbox.username,
IFNULL(GROUP_CONCAT(ga.aliases ORDER BY ga.aliases SEPARATOR ' '), ''), IFNULL(GROUP_CONCAT(ga.aliases ORDER BY ga.aliases SEPARATOR ' '), ''),

View File

@ -245,7 +245,7 @@ function transport($_action, $_data = null) {
} }
} }
} }
$destinations = array_values(array_unique($destinations)); $destinations = array_filter(array_values(array_unique($destinations)));
if (empty($destinations)) { return false; } if (empty($destinations)) { return false; }
if (isset($next_hop_matches[1])) { if (isset($next_hop_matches[1])) {
if (in_array($next_hop_clean, $existing_nh)) { if (in_array($next_hop_clean, $existing_nh)) {