Node.js based forum software built for the modern web
move regex out
Barış Soner Uşaklı619b74ca7b9b
diff --git a/src/posts/uploads.js b/src/posts/uploads.jsindex 04b5e954a4..70fd46791f 100644--- a/src/posts/uploads.js+++ b/src/posts/uploads.js@@ -12,10 +12,10 @@ module.exports = function (Posts) {const md5 = filename => crypto.createHash('md5').update(filename).digest('hex');const pathPrefix = path.join(__dirname, '../../public/uploads/files');+ const searchRegex = /\/assets\/uploads\/files\/([^\s")]+\.?[\w]*)/g;Posts.uploads.sync = function (pid, callback) {// Scans a post and updates sorted set of uploads- const searchRegex = /\/assets\/uploads\/files\/([^\s")]+\.?[\w]*)/g;async.parallel({content: async.apply(Posts.getPostField, pid, 'content'),