mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Added '^' and '$' as allowed characters in regex split to be able to use start-of-string/end-of-string in LIKE statements for device groups
This commit is contained in:
@ -20,7 +20,7 @@ $group_id = $_POST['group_id'];
|
||||
|
||||
if (is_numeric($group_id) && $group_id > 0) {
|
||||
$group = dbFetchRow('SELECT * FROM `device_groups` WHERE `id` = ? LIMIT 1', array($group_id));
|
||||
$group_split = preg_split('/([a-zA-Z0-9_\-\.\=\%\<\>\ \"\'\!\~\(\)\*\/\@\[\]]+[&&\|\|]+)/', $group['pattern'], -1, (PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY));
|
||||
$group_split = preg_split('/([a-zA-Z0-9_\-\.\=\%\<\>\ \"\'\!\~\(\)\*\/\@\[\]\^\$]+[&&\|\|]+)/', $group['pattern'], -1, (PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY));
|
||||
$count = (count($group_split) - 1);
|
||||
if (preg_match('/\&\&$/', $group_split[$count]) == 1 || preg_match('/\|\|$/', $group_split[$count]) == 1) {
|
||||
$group_split[$count] = $group_split[$count];
|
||||
|
Reference in New Issue
Block a user