[Web] Fixes #650

master
andryyy 2017-10-04 19:01:46 +02:00
parent cc2f2afc62
commit 3de01afce0
1 changed files with 2 additions and 2 deletions

View File

@ -32,7 +32,7 @@ function policy($_action, $_scope, $_data = null) {
$object_list = "whitelist_from"; $object_list = "whitelist_from";
} }
$object_from = preg_replace('/\.+/', '.', rtrim(preg_replace("/\.\*/", "*", trim(strtolower($_data['object_from']))), '.')); $object_from = preg_replace('/\.+/', '.', rtrim(preg_replace("/\.\*/", "*", trim(strtolower($_data['object_from']))), '.'));
if (!ctype_alnum(str_replace(array('@', '.', '-', '*'), '', $object_from))) { if (!ctype_alnum(str_replace(array('@', '_', '.', '-', '*'), '', $object_from))) {
$_SESSION['return'] = array( $_SESSION['return'] = array(
'type' => 'danger', 'type' => 'danger',
'msg' => sprintf($lang['danger']['policy_list_from_invalid']) 'msg' => sprintf($lang['danger']['policy_list_from_invalid'])
@ -112,7 +112,7 @@ function policy($_action, $_scope, $_data = null) {
$object_list = "whitelist_from"; $object_list = "whitelist_from";
} }
$object_from = preg_replace('/\.+/', '.', rtrim(preg_replace("/\.\*/", "*", trim(strtolower($_data['object_from']))), '.')); $object_from = preg_replace('/\.+/', '.', rtrim(preg_replace("/\.\*/", "*", trim(strtolower($_data['object_from']))), '.'));
if (!ctype_alnum(str_replace(array('@', '.', '-', '*'), '', $object_from))) { if (!ctype_alnum(str_replace(array('@', '_', '.', '-', '*'), '', $object_from))) {
$_SESSION['return'] = array( $_SESSION['return'] = array(
'type' => 'danger', 'type' => 'danger',
'msg' => sprintf($lang['danger']['policy_list_from_invalid']) 'msg' => sprintf($lang['danger']['policy_list_from_invalid'])