修复当feed item没有description时filterout参数无法起作用的BUG (#710)

RT
This commit is contained in:
叡山电车
2018-09-16 22:42:23 +08:00
committed by DIYgod
parent f90321b4f1
commit 658a58278c

View File

@@ -16,7 +16,7 @@ module.exports = async (ctx, next) => {
if (ctx.state.data && ctx.query && (ctx.query.filterout || ctx.query.filterout_title || ctx.query.filterout_description)) {
ctx.state.data.item = ctx.state.data.item.filter((item) => {
const title = item.title;
const description = item.description;
const description = item.description || title;
return (
(ctx.query.filterout && !title.match(ctx.query.filterout) && !description.match(ctx.query.filterout)) ||
(ctx.query.filterout_title && !title.match(ctx.query.filterout_title)) ||