Skip to content
Snippets Groups Projects
Commit 87d14c21 authored by Andrey Vitushkin's avatar Andrey Vitushkin
Browse files

Issue #3454388: The value in the "ipaddress_mysql" widget is converted to the CIDR format

parent 426b42ea
No related branches found
No related tags found
No related merge requests found
...@@ -29,7 +29,8 @@ final class IpAddressMySqlWidget extends WidgetBase { ...@@ -29,7 +29,8 @@ final class IpAddressMySqlWidget extends WidgetBase {
if ($items[$delta]->ip_address && $items[$delta]->network_mask) { if ($items[$delta]->ip_address && $items[$delta]->network_mask) {
$ipAddress = inet_ntop($items[$delta]->ip_address); $ipAddress = inet_ntop($items[$delta]->ip_address);
$networkMask = inet_ntop($items[$delta]->network_mask); $networkMask = inet_ntop($items[$delta]->network_mask);
$defaultValue = Network::parse("$ipAddress $networkMask")->getCIDR(); $prefixLength = Network::parse("$ipAddress $networkMask")->getPrefixLength();
$defaultValue = "$ipAddress/$prefixLength";
} }
else { else {
$defaultValue = NULL; $defaultValue = NULL;
......
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