From 836c0cecf825854917c93e67db3553ca3f1aca35 Mon Sep 17 00:00:00 2001 From: MichaelDaum Date: Tue, 17 Jan 2023 13:08:16 +0100 Subject: [PATCH] Item13883: fixed Item15163 --- core/lib/Foswiki/Sandbox.pm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/core/lib/Foswiki/Sandbox.pm b/core/lib/Foswiki/Sandbox.pm index 4e98c5513..f07eb2446 100644 --- a/core/lib/Foswiki/Sandbox.pm +++ b/core/lib/Foswiki/Sandbox.pm @@ -238,16 +238,16 @@ sub _cleanUpFilePath { next unless ( defined($component) && $component ne '' || $first ); $first = 0; $component = '' unless defined $component; - next if $component eq '.'; - if ( $component eq '..' ) { - throw Error::Simple( 'relative path in filename ' . $string ); - } - elsif ( $component =~ m/$Foswiki::cfg{AttachmentNameFilter}/ ) { + if ( $component =~ m/$Foswiki::cfg{AttachmentNameFilter}/ ) { throw Error::Simple( 'illegal characters in file name component "' . $component . '" of filename ' . $string ); } + next if $component eq '.'; + if ( $component eq '..' ) { + throw Error::Simple( 'relative path in filename ' . $string ); + } push( @result, $component ); }