Skip to content

Commit

Permalink
whitelist all allowed characters in filenames, see #75
Browse files Browse the repository at this point in the history
  • Loading branch information
rlidwka committed Jun 17, 2014
1 parent 2052411 commit 88f3944
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ module.exports.validate_name = function(name) {
if (typeof(name) !== 'string') return false
name = name.toLowerCase()
if (
// all URL-safe characters and "@" for issue #75
!name.match(/^[-a-zA-Z0-9_.!~*'()@]+$/) ||
name.charAt(0) === '.' || // ".bin", etc.
name.charAt(0) === '-' || // "-" is reserved by couchdb
name.match(/[\\\/\s\+%:]/) ||
name === 'node_modules' ||
name === '__proto__' ||
name === 'package.json' ||
Expand Down

0 comments on commit 88f3944

Please sign in to comment.