Skip to content

Commit 945d011

Browse files
committed
compatible with empty author
1 parent fcffffc commit 945d011

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

routes/get.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
function htmlEncode (str) {
2-
return str.replace(/&/g, '&')
2+
return str ? str.replace(/&/g, '&')
33
.replace(/</g, '&lt;')
44
.replace(/>/g, '&gt;')
55
.replace(/"/g, '&quot;')
66
.replace(/'/g, '&#x27;')
7-
.replace(/\//g, '&#x2f;');
7+
.replace(/\//g, '&#x2f;') : '';
88
}
99

1010
module.exports = async (ctx) => {

0 commit comments

Comments
 (0)