mirror of
https://github.com/mailcow/mailcow-dockerized.git
synced 2024-12-15 09:00:26 +08:00
Remove duplicated SQL
This commit is contained in:
parent
ae6d7d63fc
commit
2444cd1cd2
@ -5134,11 +5134,7 @@ function add_forwarding_host($postarray) {
|
|||||||
if ($source == $host)
|
if ($source == $host)
|
||||||
$source = '';
|
$source = '';
|
||||||
try {
|
try {
|
||||||
if ($filter_spam) { // if the host already exists, REPLACE it with the spam filter turned on
|
$stmt = $pdo->prepare("REPLACE INTO `forwarding_hosts` (`host`, `source`, `filter_spam`) VALUES (:host, :source, :filter_spam)");
|
||||||
$stmt = $pdo->prepare("REPLACE INTO `forwarding_hosts` (`host`, `source`, `filter_spam`) VALUES (:host, :source, :filter_spam)");
|
|
||||||
} else { // if the host already exists, IGNORE it no matter whether the spam filter is already turned on
|
|
||||||
$stmt = $pdo->prepare("INSERT IGNORE INTO `forwarding_hosts` (`host`, `source`, `filter_spam`) VALUES (:host, :source, :filter_spam)");
|
|
||||||
}
|
|
||||||
$stmt->execute(array(
|
$stmt->execute(array(
|
||||||
':host' => $host,
|
':host' => $host,
|
||||||
':source' => $source,
|
':source' => $source,
|
||||||
|
Loading…
Reference in New Issue
Block a user