Skip to content

Commit

Permalink
Merge pull request #2488 from Alex-Jordan/scoring
Browse files Browse the repository at this point in the history
update usage of checkName
  • Loading branch information
drgrice1 committed Aug 6, 2024
2 parents b38fcba + b204955 commit dc60d3b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions lib/WeBWorK/ContentGenerator/Instructor/Scoring.pm
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ sub initialize ($c) {
my $scoringFileName = $c->param('scoringFileName') || "${courseName}_totals";
$scoringFileName =~ s/\.csv\s*$//;
$scoringFileName .= '.csv'; # must end in .csv
my $scoringFileNameOK =
($scoringFileName eq WeBWorK::ContentGenerator::Instructor::FileManager::checkName($scoringFileName));
my $scoringFileNameOK = !$c->WeBWorK::ContentGenerator::Instructor::FileManager::checkName($scoringFileName);
$c->{scoringFileName} = $scoringFileName;

$c->{padFields} = defined($c->param('padFields')) ? 1 : 0;
Expand Down
2 changes: 1 addition & 1 deletion lib/WeBWorK/ContentGenerator/Instructor/ScoringDownload.pm
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ sub pre_header_initialize ($c) {
# the parameter 'getFile" needs to be sanitized. (see bug #3793 )
# See checkName in FileManager.pm for a more complete sanitization.
if ($authz->hasPermissions($user, "score_sets")) {
unless ($file eq WeBWorK::ContentGenerator::Instructor::FileManager::checkName($file)) { #
if ($c->WeBWorK::ContentGenerator::Instructor::FileManager::checkName($file)) {
$c->addbadmessage($c->maketext("Your file name is not valid! "));
$c->addbadmessage($c->maketext(
"A file name cannot begin with a dot, it cannot be empty, it cannot contain a "
Expand Down

0 comments on commit dc60d3b

Please sign in to comment.