v1.18.x
Baris Usakli 8 years ago
parent 45d940ad2b
commit dc110e2e3f

@ -10,7 +10,7 @@ var Meta = require('../meta');
var Tags = module.exports;
Tags.parse = function (req, meta, link, callback) {
Tags.parse = function (req, data, meta, link, callback) {
async.parallel({
tags: function (next) {
var defaultTags = [{
@ -50,7 +50,7 @@ Tags.parse = function (req, meta, link, callback) {
});
}
plugins.fireHook('filter:meta.getMetaTags', defaultTags, next);
plugins.fireHook('filter:meta.getMetaTags', { req: req, data: data, defaultTags: defaultTags }, next);
},
links: function (next) {
var defaultLinks = [{
@ -101,7 +101,7 @@ Tags.parse = function (req, meta, link, callback) {
href: nconf.get('relative_path') + '/assets/uploads/system/touchicon-192.png',
});
}
plugins.fireHook('filter:meta.getLinkTags', defaultLinks, next);
plugins.fireHook('filter:meta.getLinkTags', { req: req, data: data, defaultLinks: defaultLinks }, next);
},
}, function (err, results) {
if (err) {

@ -105,7 +105,7 @@ module.exports = function (middleware) {
});
},
navigation: async.apply(navigation.get),
tags: async.apply(meta.tags.parse, req, res.locals.metaTags, res.locals.linkTags),
tags: async.apply(meta.tags.parse, req, data, res.locals.metaTags, res.locals.linkTags),
banned: async.apply(user.isBanned, req.uid),
banReason: async.apply(user.getBannedReason, req.uid),
}, next);

Loading…
Cancel
Save