TT#8704 Tighten peer name to not break kamailio

This prevents e.g. to insert \", which will break the trigger
populating kamailio, and will also protect against SQL injection
attacks, because the "name" value is taken as is in the trigger
statement without escaping it.

Change-Id: Ic2f911f4ce7fa79516796141d565bd3fe4a4044a
changes/40/16140/4
Andreas Granig 8 years ago
parent e10cc89715
commit e11ebefbe3

@ -119,6 +119,13 @@ has_block 'actions' => (
render_list => [qw/save/],
);
sub validate_name {
my ($self, $field) = @_;
unless($field->value =~ /^[a-zA-Z0-9_\- ]+$/) {
$field->add_error("Invalid characters in name");
}
}
sub validate_via_route {
my ($self, $field) = @_;

Loading…
Cancel
Save