From 53e8bf537b22df58d2ed0bc82bfd376bd4358285 Mon Sep 17 00:00:00 2001 From: andryyy Date: Tue, 8 Jan 2019 13:00:34 +0100 Subject: [PATCH] [Web] Save filter objects 1:1 to database --- data/web/admin.php | 2 +- data/web/inc/functions.policy.inc.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/data/web/admin.php b/data/web/admin.php index e203f0d7..31085b7b 100644 --- a/data/web/admin.php +++ b/data/web/admin.php @@ -206,7 +206,7 @@ $tfa_data = get_tfa();
- +
diff --git a/data/web/inc/functions.policy.inc.php b/data/web/inc/functions.policy.inc.php index 12aacdd5..114e266b 100644 --- a/data/web/inc/functions.policy.inc.php +++ b/data/web/inc/functions.policy.inc.php @@ -42,7 +42,7 @@ function policy($_action, $_scope, $_data = null) { elseif ($_data['object_list'] == "wl") { $object_list = "whitelist_from"; } - $object_from = preg_replace('/\.+/', '.', rtrim(preg_replace("/\.\*/", "*", trim(strtolower($_data['object_from']))), '.')); + $object_from = trim(strtolower($_data['object_from'])); if (!ctype_alnum(str_replace(array('@', '_', '.', '-', '*'), '', $object_from))) { $_SESSION['return'][] = array( 'type' => 'danger', @@ -104,7 +104,7 @@ function policy($_action, $_scope, $_data = null) { elseif ($_data['object_list'] == "wl") { $object_list = "whitelist_from"; } - $object_from = preg_replace('/\.+/', '.', rtrim(preg_replace("/\.\*/", "*", trim(strtolower($_data['object_from']))), '.')); + $object_from = trim(strtolower($_data['object_from'])); if (!ctype_alnum(str_replace(array('@', '_', '.', '-', '*'), '', $object_from))) { $_SESSION['return'][] = array( 'type' => 'danger',