Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Properly quote file names in the regexp used to extract backup times. #2688

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

drgrice1
Copy link
Member

@drgrice1 drgrice1 commented Mar 18, 2025

If a backup filename contains certain special characters, then an exception is thrown when used in the regular expression to extract the time from the backup filename. To protect against this the metaquoting escape sequence (\Q...\E) is needed.

This fixes issue #2680.

Edit: Also allow parenthesis in file names in the file manager. I went to delete the file I created to test the first part of this pull request, and discovered that I could not because the FileManager checkPWD method considers parentheses (or really anything except -_./A-Z0-9~, ) to be an illegal character. This probably needs to be revisited. There are lots of other valid characters in file names that this does not allow.

If a backup filename contains certain special characters, then an
exception is thrown when used in the regular expression to extract the
time from the backup filename. To protect against this the metaquoting
escape sequence (`\Q...\E`) is needed.

This fixes issue openwebwork#2680.
… the File Manager.

This prevents deletion of files that have parentheses in the name.
@drgrice1 drgrice1 force-pushed the problem-editor-backup-times-quotemeta branch from 02ada58 to a80be41 Compare March 18, 2025 22:43
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.

1 participant