Unbound: typo (#6360)

Type casting in wrong place: may skip updateBlocklist action if model node exists but empty
This commit is contained in:
kulikov-a 2023-02-26 14:31:07 +03:00 committed by GitHub
parent 657be3ce6a
commit f394a78f61
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -48,7 +48,7 @@ class SettingsController extends ApiMutableModelControllerBase
$domain = $this->request->getPost('domain');
$type = $this->request->getPost('type');
$mdl = $this->getModel();
$item = (string)$mdl->getNodeByReference('dnsbl.' . $type);
$item = $mdl->getNodeByReference('dnsbl.' . $type);
if ($item != null) {
$remove = function ($csv, $part) {
@ -63,7 +63,7 @@ class SettingsController extends ApiMutableModelControllerBase
$wl = explode(',', (string)$mdl->dnsbl->whitelists);
$bl = explode(',', (string)$mdl->dnsbl->blocklists);
$existing_domains = explode(',', $item);
$existing_domains = explode(',', (string)$item);
if (in_array($value, $existing_domains)) {
// value already in model, no need to re-run a potentially
// expensive dnsbl action