Skip to content

show desired course ID in messages for when course does not exist#2943

Merged
somiaj merged 1 commit intoopenwebwork:WeBWorK-2.21from
Alex-Jordan:archive
Apr 7, 2026
Merged

show desired course ID in messages for when course does not exist#2943
somiaj merged 1 commit intoopenwebwork:WeBWorK-2.21from
Alex-Jordan:archive

Conversation

@Alex-Jordan
Copy link
Copy Markdown
Contributor

If you try to visit a course that does not exist (including the situation where a course has been archived and closed), you see one of these messages affected here. The change is to display the desired course ID in the message. Of course, you could see the desired course ID in the address bar. But Safari doesn't show the address bar unless you make extra effort.

This is frustrating when someone sends me a screenshot from Safari, and they are in this situation. It's often the case that they are using LTI, and did not update LTI links to a new WeBWorK course when they copied the LMS course. It would be easier to diagnose and convince people this is the issue if the messages here included the desired courseID.

Copy link
Copy Markdown
Member

@drgrice1 drgrice1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks fine.

Though at first I was concerned that this might be a potential XSS vulnerability, but it is not. If, for example, the URL contained something like https://server.edu/webwork2/badCourseId<script>alert('hello')<%2Fscript> the #courseID route capture does not get that because it only allows word characters and hyphens. In fact doesn't match any routes and gives a 404 not found due to the changes in #2691.

@drgrice1
Copy link
Copy Markdown
Member

drgrice1 commented Apr 7, 2026

Did you want to target this to the release candidate branch?

@somiaj somiaj changed the base branch from develop to WeBWorK-2.21 April 7, 2026 19:12
@somiaj
Copy link
Copy Markdown
Contributor

somiaj commented Apr 7, 2026

I am just going to approve and put in the release candidate branch.

@somiaj somiaj merged commit fb3b720 into openwebwork:WeBWorK-2.21 Apr 7, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants