Merge branch 'develop' into feature/396-localisation

indiachan-spamvector
Thomas Lynch 2 years ago
commit 0d078db10d
  1. 6
      CHANGELOG.md
  2. 2
      controllers/forms/addflags.js
  3. 18
      controllers/forms/uploadbanners.js
  4. 4
      package-lock.json
  5. 2
      package.json

@ -1,3 +1,9 @@
### 0.11.2
- Convert the assets page form handling to the newer checkSchema code.
- Don't show the "Edit" option in the post dropdowns for public pages.
- Bugfix "my permission" page not displaying correctly and board staff permission editing not applying.
- Improve required parent permission display to show "requires X" in the tooltip of disabled checkboxes.
### 0.11.1 ### 0.11.1
- Bugfix non logged in users not able to use actions because of an issue in move post logic (thanks @some_random_guy). - Bugfix non logged in users not able to use actions because of an issue in move post logic (thanks @some_random_guy).
- Bugfix editing posts from the actions form (not the new dropdown "Edit" button) always redirecting to OP. - Bugfix editing posts from the actions form (not the new dropdown "Edit" button) always redirecting to OP.

@ -17,7 +17,7 @@ module.exports = {
const errors = await checkSchema([ const errors = await checkSchema([
{ result: res.locals.numFiles === 0, expected: false, blocking: true, error: 'Must provide a file' }, { result: res.locals.numFiles === 0, expected: false, blocking: true, error: 'Must provide a file' },
{ result: numberBody(res.locals.numFiles, 0, globalLimits.flagFiles.max), expected: true, error: `Exceeded max flag uploads in one request of ${globalLimits.flagFiles.max}` }, { result: numberBody(res.locals.numFiles, 0, globalLimits.flagFiles.max), expected: true, error: `Exceeded max flag uploads in one request of ${globalLimits.flagFiles.max}` },
{ result: numberBody(res.locals.board.flags.length+res.locals.numFiles, 0, globalLimits.flagFiles.max), expected: true, error: `Total number of flags would exceed global limit of ${globalLimits.flagFiles.total}` }, { result: numberBody(Object.keys(res.locals.board.flags).length+res.locals.numFiles, 0, globalLimits.flagFiles.max), expected: true, error: `Total number of flags would exceed global limit of ${globalLimits.flagFiles.total}` },
]); ]);
if (errors.length > 0) { if (errors.length > 0) {

@ -3,7 +3,8 @@
const uploadBanners = require(__dirname+'/../../models/forms/uploadbanners.js') const uploadBanners = require(__dirname+'/../../models/forms/uploadbanners.js')
, dynamicResponse = require(__dirname+'/../../lib/misc/dynamic.js') , dynamicResponse = require(__dirname+'/../../lib/misc/dynamic.js')
, deleteTempFiles = require(__dirname+'/../../lib/file/deletetempfiles.js') , deleteTempFiles = require(__dirname+'/../../lib/file/deletetempfiles.js')
, config = require(__dirname+'/../../lib/misc/config.js'); , config = require(__dirname+'/../../lib/misc/config.js')
, { checkSchema, numberBody } = require(__dirname+'/../../lib/input/schema.js');
module.exports = { module.exports = {
@ -12,15 +13,12 @@ module.exports = {
controller: async (req, res, next) => { controller: async (req, res, next) => {
const { globalLimits } = config.get; const { globalLimits } = config.get;
const errors = [];
const errors = await checkSchema([
if (res.locals.numFiles === 0) { { result: res.locals.numFiles === 0, expected: false, blocking: true, error: 'Must provide a file' },
errors.push('Must provide a file'); { result: numberBody(res.locals.numFiles, 0, globalLimits.bannerFiles.max), expected: true, error: `Exceeded max banner uploads in one request of ${globalLimits.bannerFiles.max}` },
} else if (res.locals.numFiles > globalLimits.bannerFiles.max) { { result: numberBody(res.locals.board.banners.length+res.locals.numFiles, 0, globalLimits.bannerFiles.max), expected: true, error: `Total number of banners would exceed global limit of ${globalLimits.bannerFiles.total}` },
errors.push(`Exceeded max banner uploads in one request of ${globalLimits.bannerFiles.max}`); ]);
} else if (res.locals.board.banners.length+res.locals.numFiles > globalLimits.bannerFiles.total) {
errors.push(`Total number of banners would exceed global limit of ${globalLimits.bannerFiles.total}`);
}
if (errors.length > 0) { if (errors.length > 0) {
await deleteTempFiles(req).catch(console.error); await deleteTempFiles(req).catch(console.error);

4
package-lock.json generated

@ -1,12 +1,12 @@
{ {
"name": "jschan", "name": "jschan",
"version": "0.11.1", "version": "0.11.2",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "jschan", "name": "jschan",
"version": "0.11.1", "version": "0.11.2",
"license": "AGPL-3.0-only", "license": "AGPL-3.0-only",
"dependencies": { "dependencies": {
"@fatchan/express-fileupload": "^1.4.2", "@fatchan/express-fileupload": "^1.4.2",

@ -1,6 +1,6 @@
{ {
"name": "jschan", "name": "jschan",
"version": "0.11.1", "version": "0.11.2",
"migrateVersion": "0.11.0", "migrateVersion": "0.11.0",
"description": "", "description": "",
"main": "server.js", "main": "server.js",

Loading…
Cancel
Save