Skip to content

Commit

Permalink
Closes #1147
Browse files Browse the repository at this point in the history
  • Loading branch information
justingit committed Apr 7, 2023
1 parent 4dc65c1 commit 94d615a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions app/dada/DADA/App.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1594,15 +1594,19 @@ sub drag_and_drop_file_upload {
);

my $bad_fn = {};
for(@bad_fn){$bad_fn->{'.' . $_} = 1};
for(@bad_fn){
$bad_fn->{'.' . $_} = 1;
$bad_fn->{'.' . uc($_)} = 1;
};

my ($ext) = $filename =~ /(\.[^.]+)$/;

if(exists($bad_fn->{$ext})){
return ( 0, 'Problems with the upload: unsupported file type', undef, undef, undef );
}

my $subfolder = 'files';
if ( $filename =~ m/\.(jpg|jpeg|png|gif)$/ ) {
if ( $filename =~ m/\.(jpg|jpeg|png|gif)$/i ) {
$subfolder = 'images';
}

Expand All @@ -1624,7 +1628,7 @@ sub drag_and_drop_file_upload {
or die $!;
chmod( $DADA::Config::FILE_CHMOD, $save_fp );

if ( $filename =~ m/\.(jpg|jpeg|png|gif)$/ ) {
if ( $filename =~ m/\.(jpg|jpeg|png|gif)$/i ) {
if($ls->param('resize_drag_and_drop_images') == 1){
require DADA::App::ResizeImages;
my ($rs_status, $rs_path, $rs_width, $rs_height) = DADA::App::ResizeImages::resize_image(
Expand Down

0 comments on commit 94d615a

Please sign in to comment.