Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions lib/WeBWorK/ContentGenerator/CourseAdmin.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1233,6 +1233,10 @@ sub unarchive_course_validate ($c) {
push @errors, $c->maketext('Course ID cannot exceed [_1] characters.', $ce->{maxCourseIdLength});
}

unless ($courseID =~ /^[\w-]*$/) { # regex copied from CourseAdministration.pm
push @errors, $c->maketext('Course ID may only contain letters, numbers, hyphens, and underscores.');
}

return @errors;
}

Expand Down
6 changes: 1 addition & 5 deletions lib/WeBWorK/Utils/CourseManagement.pm
Original file line number Diff line number Diff line change
Expand Up @@ -505,11 +505,7 @@ sub renameCourse {
}

# get new course environment
my $newCE = $oldCE->new(
$oldCE->{webworkDirs}->{root},
$oldCE->{webworkURLs}->{root},
$oldCE->{pg}->{directories}->{root}, $newCourseID,
);
my $newCE = $oldCE->new({ courseName => $newCourseID });

# find the course dirs that still exist in their original locations
# (i.e. are not subdirs of $courseDir)
Expand Down