diff --git a/admin_ipsandports.php b/admin_ipsandports.php
index e8f796b3c4..c660bc21c5 100644
--- a/admin_ipsandports.php
+++ b/admin_ipsandports.php
@@ -142,8 +142,10 @@
}
} elseif ($action == 'jqCheckIP') {
$ip = $_POST['ip'] ?? "";
- if ((filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) || filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) && filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_RES_RANGE | FILTER_FLAG_NO_PRIV_RANGE) == false) {
- // returns notice if private network detected so we can display it
+ if (!filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 | FILTER_FLAG_IPV6)) {
+ echo json_encode('
'.lng('error.invalidip', [$ip]).'
');
+ } elseif (!filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_RES_RANGE | FILTER_FLAG_NO_PRIV_RANGE)) {
+ // returns notice if private network detected, so we can display it
echo json_encode(lng('admin.ipsandports.ipnote'));
} else {
echo 0;
diff --git a/templates/Froxlor/assets/js/jquery/domains.js b/templates/Froxlor/assets/js/jquery/domains.js
index 6826086530..a9b7458d24 100644
--- a/templates/Froxlor/assets/js/jquery/domains.js
+++ b/templates/Froxlor/assets/js/jquery/domains.js
@@ -48,6 +48,7 @@ export default function () {
id: $('input[name=id]').val(), newval: +$('#speciallogfile').is(':checked')
},
dataType: "json",
+ async: false,
beforeSend: function (request) {
request.setRequestHeader('X-CSRF-TOKEN', document.querySelector('meta[name="csrf-token"]').getAttribute('content'));
},