mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-04 09:50:09 +00:00
Fixes validation of unexpected servers whitelist
This commit is contained in:
parent
7c9631b955
commit
b87e641086
6 changed files with 11 additions and 18 deletions
|
|
@ -658,23 +658,9 @@ const ItemsList = (gui, hooks, script_subdir, script_key) => {
|
|||
|
||||
const apply_event = (event) => {
|
||||
|
||||
const special_char_regexp = /[\@\#\<\>\\\/\?\'\"\`\~\|\:\;\!\&\*\(\)\{\}\[\]\_\-\+\=\%\$\^]/g;
|
||||
const hook_enabled = $('#itemslist-checkbox').prop('checked');
|
||||
|
||||
let $error_label = $('#itemslist-textarea').parent().find('.invalid-feedback');
|
||||
$error_label.fadeOut();
|
||||
|
||||
const textarea_value = $('#itemslist-textarea').val().trim();
|
||||
|
||||
// if the textarea value contains special characters such as #, @, ... then alert the user
|
||||
if (special_char_regexp.test(textarea_value)) {
|
||||
$error_label.fadeIn().text(`${i18n.items_list_comma}`);
|
||||
return;
|
||||
}
|
||||
|
||||
// hide label
|
||||
$error_label.hide();
|
||||
|
||||
const items_list = textarea_value ? textarea_value.split(',').map(x => x.trim()) : [];
|
||||
|
||||
const template_data = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue