Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

Commit

Permalink
Fix #2981, sanitize download filename more fully
Browse files Browse the repository at this point in the history
This adds : (important on Windows), \, <, and > to the blacklist.
Followup in #3083
  • Loading branch information
ianb committed Jul 10, 2017
1 parent 4ae42cc commit af32978
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion shared/shot.js
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ class AbstractShot {
get filename() {
let filenameTitle = this.title;
let date = new Date(this.createdDate);
filenameTitle = filenameTitle.replace(/[\/!@&*.|\n\r\t]/g, " ");
filenameTitle = filenameTitle.replace(/[:\\<>\/!@&*.|\n\r\t]/g, " ");
filenameTitle = filenameTitle.replace(/\s{1,4000}/g, " ");
let clipFilename = `Screenshot-${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()} ${filenameTitle}`;
const clipFilenameBytesSize = clipFilename.length * 2; // JS STrings are UTF-16
Expand Down

0 comments on commit af32978

Please # to comment.