Authored by 周少峰

Merge branch 'hotfix/guang'

... ... @@ -50,7 +50,7 @@ const index = (req, res, next) => {
return res.send(feed.render('atom-1.0'));
}
return res.send(feed.render('rss-2.0'));
});
}).catch(next);
};
const rss = (req, res, next, gmt) => {
let gender = req.query.gender || '1,2,3',
... ... @@ -72,7 +72,7 @@ const rss = (req, res, next, gmt) => {
layout: false,
items: result
});
});
}).catch(next);
};
module.exports = {
... ...
... ... @@ -18,7 +18,7 @@ const removeHtml = (str) => {
* [html转为转义]
*/
const htmlToEscape = (html) => {
return html.replace(/[<>&"]/g, (e) => {
return (html || '').replace(/[<>&"]/g, (e) => {
return _htmlMap[e];
});
};
... ... @@ -27,7 +27,7 @@ const htmlToEscape = (html) => {
* [转义符转为html]
*/
const escapeToHtml = (str) => {
return str.replace(/&(lt|gt|nbsp|amp|quot);/g, (match, e) => {
return (str || '').replace(/&(lt|gt|nbsp|amp|quot);/g, (match, e) => {
return _EscapeMap[e];
});
};
... ...