-
Notifications
You must be signed in to change notification settings - Fork 153
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
ISSUE-675: sanitize filename in video recorder #683
base: master
Are you sure you want to change the base?
Conversation
10c2bcb
to
debbb0b
Compare
@@ -12,7 +12,10 @@ class VideosImpl( | |||
) : Videos { | |||
|
|||
override fun record(tag: String) { | |||
val videoFile: File = resourceFilesProvider.provideVideoFile(tag) | |||
val sanitizedVideoName = tag |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this be a breaking change or not?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we believe the comment in the original isse, then this changes fix only the broken case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor issues. May release as is, but I would change it in the future
@@ -12,7 +12,10 @@ class VideosImpl( | |||
) : Videos { | |||
|
|||
override fun record(tag: String) { | |||
val videoFile: File = resourceFilesProvider.provideVideoFile(tag) | |||
val sanitizedVideoName = tag | |||
.replace("[/:\"*?<>|]+".toRegex(), "") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- The issue creator used backing slash to cover each special simbol. It's not needed?
- Please, replace with the undescrore. User expected a simbol there
- Please, if the video name changed, then leave a warning log with something like
log("Can't record video with name $tag since it contains one of the following special characters [/:\"*?<>|]. Changing the name to $sanitizedVideoName")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- We don't need this. IDE marks these special symbols as redundant.
- Done
- Done
No description provided.