diff options
author | isaacs <i@izs.me> | 2010-05-06 08:20:56 +0400 |
---|---|---|
committer | isaacs <i@izs.me> | 2010-05-06 10:13:30 +0400 |
commit | 7db2e7271d22e9a4c8ece520c0442000a53db1d0 (patch) | |
tree | 16e0fd844b4ae9e1acd9fe94397797bd70e11d2e /lib | |
parent | 3a5fe65cc9da4bee020686b7ca86745805e74f86 (diff) |
Still dont' allow slashes in names. Anything else is fine.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/utils/read-json.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/utils/read-json.js b/lib/utils/read-json.js index 282fbedd9..728934956 100644 --- a/lib/utils/read-json.js +++ b/lib/utils/read-json.js @@ -30,13 +30,15 @@ function readJson (jsonFile, cb) { } }); + // slashes would be a security risk. + json.name = json.name.replace(/\//g, '-'); // allow semvers, but also stuff like // 0.1.2beta-L24561-2010-02-25-13-41-32-903 for test/link packages. if (!(semver.valid(json.version))) { return cb(new Error("Invalid version: "+json.version)); } - var key = json.name+"@"+json.version; + var key = json.name+"-"+json.version; json._id = key; testEngine(json, cb); }); |