From 5eb3eaa529c9cf51b9b2209d5d18e207da06e502 Mon Sep 17 00:00:00 2001 From: Luis Daniel Lucio Quiroz Date: Sun, 13 Dec 2020 20:18:02 -0500 Subject: [PATCH] Update extension_edit.php --- app/extensions/extension_edit.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/app/extensions/extension_edit.php b/app/extensions/extension_edit.php index bbb3545e79..f0f85db340 100644 --- a/app/extensions/extension_edit.php +++ b/app/extensions/extension_edit.php @@ -133,6 +133,24 @@ $voicemail_id = null; } + $cidrs = preg_split("/[\s,]+/", $cidr); + $ips = array(); + foreach ($cidrs as $ipaddr){ + $cx = strpos($ipaddr, '/'); + if ($cx){ + $subnet = (int)(substr($ipaddr, $cx+1)); + $ipaddr = substr($ipaddr, 0, $cx); + } + else{ + $subnet = 32; + } + + if(($addr = inet_pton($ipaddr)) !== false){ + $ips[] = $ipaddr.'/'.$subnet; + } + } + $cidr = implode(',',$ips); + //change toll allow delimiter $toll_allow = str_replace(',',':', $toll_allow);