Skip to content
Snippets Groups Projects
Commit 06523a8b authored by Marius Burkard's avatar Marius Burkard
Browse files

Merge branch '5975-dns-soa-input' into 'develop'

Add numerical check for subnet (#5975)

Closes #5975

See merge request ispconfig/ispconfig3!1369
parents 416c9fa8 f064194e
No related branches found
No related tags found
No related merge requests found
......@@ -310,7 +310,6 @@ class validate_dns {
if(strpos($ip, '/') !== false) {
list($ip, $subnet) = explode('/', $ip, 2);
$ip = trim($ip);
$subnet = intval($subnet);
}
if(function_exists('filter_var')) {
if(!filter_var($ip, FILTER_VALIDATE_IP)) {
......@@ -320,7 +319,11 @@ class validate_dns {
} else $this->errorMessage .= "function filter_var missing <br />\r\n";
// Check if the range is valid
if ($subnet !== '') {
if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {
if (!is_numeric($subnet)) {
$errmsg = $validator['errmsg'];
$errorMessage .= $app->tform->lng($errmsg)."<br />\r\n";
}
elseif (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {
if ($subnet < 1 || $subnet > 128) {
$errmsg = $validator['errmsg'];
$errorMessage .= $app->tform->lng($errmsg)."<br />\r\n";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment