FU: Reject some invalid characters in path

This commit is contained in:
Yorhel 2025-05-09 08:32:41 +02:00
parent 52c36e0aea
commit 6c54ee3091
2 changed files with 3 additions and 1 deletions

View file

@ -20,7 +20,7 @@ our @EXPORT_OK = qw/
sub utf8_decode :prototype($) {
return if !defined $_[0];
confess 'Invalid UTF-8' if !utf8::decode($_[0]);
confess 'Invalid control character' if $_[0] =~ /[\x00-\x08\x0b\x0c\x0e-\x1f]/;
confess 'Invalid control character' if $_[0] =~ /[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]/;
$_[0]
}