Skip to content

Commit

Permalink
Fix incorrect logic for determining when an uploaded file can be over…
Browse files Browse the repository at this point in the history
…written.
  • Loading branch information
drgrice1 committed Jul 30, 2024
1 parent 165fa8e commit 25c9129
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/WeBWorK/ContentGenerator/Instructor/FileManager.pm
Original file line number Diff line number Diff line change
Expand Up @@ -754,10 +754,12 @@ sub Upload ($c) {
&& grep { Mojo::File->new("$dir/$name")->realpath eq Mojo::File->new("$c->{courseRoot}/$_")->realpath }
@{ $c->ce->{uneditableCourseFiles} };

if (($invalidUploadFilenameMsg || $isProtected)
|| !$c->param('overwrite')
|| $action ne 'Overwrite'
|| $action ne $c->maketext('Overwrite'))
if (
($invalidUploadFilenameMsg || $isProtected)
|| (!$c->param('overwrite')
&& $action ne 'Overwrite'
&& $action ne $c->maketext('Overwrite'))
)
{
return $c->c(
$c->Confirm(
Expand Down

0 comments on commit 25c9129

Please sign in to comment.