From 945d01179ca3a60f1c6bcfc8140caca41e218a90 Mon Sep 17 00:00:00 2001 From: DIYgod Date: Sat, 14 Jul 2018 18:49:23 +0800 Subject: [PATCH] compatible with empty author --- routes/get.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/routes/get.js b/routes/get.js index 82429d9..c08adba 100644 --- a/routes/get.js +++ b/routes/get.js @@ -1,10 +1,10 @@ function htmlEncode (str) { - return str.replace(/&/g, '&') + return str ? str.replace(/&/g, '&') .replace(//g, '>') .replace(/"/g, '"') .replace(/'/g, ''') - .replace(/\//g, '/'); + .replace(/\//g, '/') : ''; } module.exports = async (ctx) => {