Browse Source

fix: expect undefined/null values

pull/8505/head
Pranav C 6 months ago
parent
commit
f12098f313
  1. 6
      packages/nocodb/src/utils/emailUtils.ts

6
packages/nocodb/src/utils/emailUtils.ts

@ -8,8 +8,8 @@ const encode = (str: string) => {
// a method to sanitise content and avoid any link/url injection in email content and html encode special chars
// for example: example.com to be converted as example<span>.<span>com
export const sanitiseEmailContent = (content: string) => {
export const sanitiseEmailContent = (content?: string) => {
return content
.replace(/[<>&;?#,'"$]+/g, encode)
.replace(/\.|\/\/:/g, '<span>$&</span>');
?.replace(/[<>&;?#,'"$]+/g, encode)
?.replace(/\.|\/\/:/g, '<span>$&</span>');
};

Loading…
Cancel
Save