hotfix editing broken filters

note: i am dumb and the testing account has BYPASS_FILTERS so what i broke in changing filters went unnoticed
in future, will add more tests w/ different permission levels
indiachan-spamvector
Thomas Lynch 2 years ago
parent 9884ca2665
commit 6c9f0a211f
  1. 2
      lib/post/getfilterstrings.js
  2. 2
      models/forms/editpost.js

@ -3,7 +3,7 @@
module.exports = (req, res, strict=false) => {
//combines a bunch of parts of the post (name, subject, message, filenames+phashes)
const fileStrings = res.locals.numFiles === 0 ? '' : req.files.file.map(f => `${f.name}|${f.phash || ''}`).join('|');
const fileStrings = res.locals.numFiles ? req.files.file.map(f => `${f.name}|${f.phash || ''}`).join('|') : 0;
const combinedString = [req.body.name, req.body.message, req.body.subject, req.body.email, fileStrings].join('|').toLowerCase();
let strictCombinedString = combinedString;

@ -29,7 +29,7 @@ todo: handle some more situations
const { board, post } = res.locals;
//filters
if (res.locals.permissions.get(Permissions.BYPASS_FILTERS)) {
if (!res.locals.permissions.get(Permissions.BYPASS_FILTERS)) {
//only global filters are checked, because anybody who could edit bypasses board filters
const { filters, filterMode, filterBanDuration } = config.get;
if (filters.length > 0 && filterMode > 0) {

Loading…
Cancel
Save