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
(cherry picked from commit e11ebefbe3)
changes/22/16322/1
Andreas Granig 8 years ago
parent c71a1fd761
commit 298ab8b069

@ -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