Merge branch 'develop' into feature/396-localisation

indiachan-spamvector
Thomas Lynch 1 year 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
- 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.

@ -17,7 +17,7 @@ module.exports = {
const errors = await checkSchema([
{ 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.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) {

@ -3,7 +3,8 @@
const uploadBanners = require(__dirname+'/../../models/forms/uploadbanners.js')
, dynamicResponse = require(__dirname+'/../../lib/misc/dynamic.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 = {
@ -12,15 +13,12 @@ module.exports = {
controller: async (req, res, next) => {
const { globalLimits } = config.get;
const errors = [];
if (res.locals.numFiles === 0) {
errors.push('Must provide a file');
} else if (res.locals.numFiles > globalLimits.bannerFiles.max) {
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}`);
}
const errors = await checkSchema([
{ result: res.locals.numFiles === 0, expected: false, blocking: true, error: '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}` },
{ 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}` },
]);
if (errors.length > 0) {
await deleteTempFiles(req).catch(console.error);

4
package-lock.json generated

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

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

Loading…
Cancel
Save