compatible with empty author

master
DIYgod 6 years ago
parent fcffffc857
commit 945d01179c
No known key found for this signature in database
GPG Key ID: EC0B76A252D3EF67
  1. 4
      routes/get.js

@ -1,10 +1,10 @@
function htmlEncode (str) {
return str.replace(/&/g, '&')
return str ? str.replace(/&/g, '&')
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;')
.replace(/"/g, '&quot;')
.replace(/'/g, '&#x27;')
.replace(/\//g, '&#x2f;');
.replace(/\//g, '&#x2f;') : '';
}
module.exports = async (ctx) => {

Loading…
Cancel
Save