Skip to content

Commit

Permalink
fix(vercel): compat with empty ua
Browse files Browse the repository at this point in the history
  • Loading branch information
lizheming committed Jan 1, 2021
1 parent 5950dce commit f39d777
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/server/src/controller/comment.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ async function formatCmt({ua, ip, ...comment}) {
ua = parser(ua)
comment.mail = helper.md5(comment.mail);
if(!think.config('disableUserAgent')) {
comment.browser = ua.browser.name + ' ' + ua.browser.version;
comment.os = ua.os.name + ' ' + ua.os.version;
comment.browser = [ua.browser.name, ua.browser.version].filter(v => v).join(' ');
comment.os = [ua.os.name, ua.os.version].filter(v => v).join(' ');
}

const blockMathRegExp = /(^|[\r\n]+|<p>|<br>)\$\$([^$]+)\$\$([\r\n]+|<\/p>|<br>|$)/g;
Expand Down

0 comments on commit f39d777

Please sign in to comment.