Skip to content

Commit

Permalink
Fix logical AND to logical OR for file uploads to prevent accidental …
Browse files Browse the repository at this point in the history
…too large of files posted.

Affects OpenUserJS#360
  • Loading branch information
Martii committed Oct 15, 2014
1 parent 8de97bd commit a4bfc52
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion controllers/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -1226,7 +1226,7 @@ exports.uploadScript = function (aReq, aRes, aNext) {
var failUrl = '/user/add/' + (isLib ? 'lib' : 'scripts');

// Reject non-js and huge files
if (script.type !== 'application/javascript' &&
if (script.type !== 'application/javascript' ||
script.size > settings.maximum_upload_script_size) {
return aRes.redirect(failUrl);
}
Expand Down

0 comments on commit a4bfc52

Please sign in to comment.