Skip to content
Snippets Groups Projects
Commit 8c8c1b9d authored by Elmar Ludwig's avatar Elmar Ludwig
Browse files

replace ip2long() with inet_pton(), fixes #4524

Closes #4524

Merge request studip/studip!3322
parent 6afb184e
No related branches found
No related tags found
No related merge requests found
...@@ -97,7 +97,7 @@ class Admin_WebserviceAccessController extends AuthenticatedController ...@@ -97,7 +97,7 @@ class Admin_WebserviceAccessController extends AuthenticatedController
continue; continue;
} }
list($ip_address, $mask) = explode('/', $ip); list($ip_address, $mask) = explode('/', $ip);
if (!ip2long($ip_address) || ($mask && ($mask < 8 || $mask > 30))) { if (!inet_pton($ip_address) || ($mask && ($mask < 0 || $mask > 128))) {
$msg['error'][] = sprintf(_("Der IP Bereich %s ist ungültig."), htmlready($ip)); $msg['error'][] = sprintf(_("Der IP Bereich %s ist ungültig."), htmlready($ip));
unset($rule->ip_range[$key]); unset($rule->ip_range[$key]);
} }
......
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