From ea60e584077462b7209e9a1527c895a632e5f3d9 Mon Sep 17 00:00:00 2001 From: Andy Beverley Date: Wed, 2 Oct 2024 17:21:57 +0100 Subject: [PATCH] Do not strip spaces on file upload, consistent with check --- lib/GADS.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/GADS.pm b/lib/GADS.pm index ed3a02a72..3ca41be8a 100644 --- a/lib/GADS.pm +++ b/lib/GADS.pm @@ -1799,7 +1799,8 @@ post '/api/file/?' => require_login sub { # Remove any invalid characters from the new name - this will possibly be changed to an error going forward # Due to dragging allowing (almost) any character it is decided that this would be best so users can input what # they want, and the text be stripped on rename server-side - $filename =~ s/[^a-zA-Z0-9\._\-\(\)]//g; + # Note: This regex should mirror the regex in GADS::Filecheck::check_name() + $filename =~ s/[^a-zA-Z0-9\._\-\(\) ]//g; my $file; if (process( sub { $file = rset('Fileval')->create({