fix permlevel and unterminated regex group

merge-requests/218/head
Thomas Lynch 3 years ago
parent 871b78cf1c
commit 9c7d061086
  1. 2
      helpers/posting/markdown.js
  2. 2
      models/forms/makepost.js

@ -10,7 +10,7 @@ const greentextRegex = /^>((?!>\d+|>>/\w+(/\d*)?|>>#
, italicRegex = /\*\*(.+?)\*\*/gm
, spoilerRegex = /\|\|([\s\S]+?)\|\|/gm
, detectedRegex = /(\(\(\(.+?\)\)\))/gm
, linkRegex = /(https?\:&#x2F;&#x2F;[^\s<>\[\]{}|\\^]+/g
, linkRegex = /(https?\:&#x2F;&#x2F;[^\s<>\[\]{}|\\^]+)/g
, aLinkRegex = /\[([^\[][^\]]*?)\]\((https?\:&#x2F;&#x2F;[^\s<>\[\]{}|\\^)]+)\)|(https?\:&#x2F;&#x2F;[^\s<>\[\]{}|\\^]+)/g
, codeRegex = /(?:(?<language>[a-z+]{1,10})\r?\n)?(?<code>[\s\S]+)/i
, includeSplitRegex = /(\[code\][\s\S]+?\[\/code\])/gm

@ -412,7 +412,7 @@ ${res.locals.numFiles > 0 ? req.files.file.map(f => f.name+'|'+(f.phash || '')).
res.locals.board.settings, res.locals.board.owner, res.locals.user ? res.locals.user.username : null);
//get message, quotes and crossquote array
const nomarkup = prepareMarkdown(req.body.message, true);
const { message, quotes, crossquotes } = await messageHandler(nomarkup, req.params.board, req.body.thread, permLevel < 4);
const { message, quotes, crossquotes } = await messageHandler(nomarkup, req.params.board, req.body.thread, res.locals.permLevel < 4);
//build post data for db. for some reason all the property names are lower case :^)
const data = {

Loading…
Cancel
Save