TT#33356 Rewrite rule validation checks for ambiguous non-char escapes

* Sequences with escaping a non-special char in the search pattern
      like \43699 or \abc are now checked and prohibited

Change-Id: I72d65f2dbf5b9b9bae1ff37af098d74d238f77cb
changes/35/19535/1
Kirill Solomko 7 years ago
parent bb655be001
commit d045b35b3c

@ -151,6 +151,10 @@ sub validate {
$self->field('replace_pattern')->add_error("Spaces are not allowed in replacement pattern"); $self->field('replace_pattern')->add_error("Spaces are not allowed in replacement pattern");
} }
if ( $s =~ /\\\w/i ) {
$self->field('match_pattern')->add_error("Ambiguous escape of non special characters");
}
my @acount; my @acount;
@acount = $s =~ /(\@\{\w+\})/g; @acount = $s =~ /(\@\{\w+\})/g;
if(@acount > 1) { if(@acount > 1) {

Loading…
Cancel
Save