mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-07 14:35:47 +01:00
move regex out
This commit is contained in:
@@ -12,10 +12,10 @@ module.exports = function (Posts) {
|
|||||||
|
|
||||||
const md5 = filename => crypto.createHash('md5').update(filename).digest('hex');
|
const md5 = filename => crypto.createHash('md5').update(filename).digest('hex');
|
||||||
const pathPrefix = path.join(__dirname, '../../public/uploads/files');
|
const pathPrefix = path.join(__dirname, '../../public/uploads/files');
|
||||||
|
const searchRegex = /\/assets\/uploads\/files\/([^\s")]+\.?[\w]*)/g;
|
||||||
|
|
||||||
Posts.uploads.sync = function (pid, callback) {
|
Posts.uploads.sync = function (pid, callback) {
|
||||||
// Scans a post and updates sorted set of uploads
|
// Scans a post and updates sorted set of uploads
|
||||||
const searchRegex = /\/assets\/uploads\/files\/([^\s")]+\.?[\w]*)/g;
|
|
||||||
|
|
||||||
async.parallel({
|
async.parallel({
|
||||||
content: async.apply(Posts.getPostField, pid, 'content'),
|
content: async.apply(Posts.getPostField, pid, 'content'),
|
||||||
|
|||||||
Reference in New Issue
Block a user