fix: preserve unicode letters/digits while still stripping unsafe characters
This commit is contained in:
1 parent
990a471af4
commit
f0731b40f8
1 file changed
+1
-1
+1
-1
@@ -31,7 +31,7 @@ sub sanitize_error_message {
|
||||
my ($err) = @_;
|
||||
return 'An error occurred' unless defined $err;
|
||||
my $sanitized = "$err";
|
||||
$sanitized =~ s/[^\w\s\.\-\:\/]//g;
|
||||
$sanitized =~ s/[^\p{L}\p{N}_\s\.\-\:\/]//gu;
|
||||
$sanitized =~ s/\s+/ /g;
|
||||
$sanitized =~ s/^\s+|\s+$//g;
|
||||
return
|
||||
|
||||
Reference in new issue
Block a user