Browse Source

fix: expect undefined/null values

pull/8505/head
Pranav C 5 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 // 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 // for example: example.com to be converted as example<span>.<span>com
export const sanitiseEmailContent = (content: string) => { export const sanitiseEmailContent = (content?: string) => {
return content return content
.replace(/[<>&;?#,'"$]+/g, encode) ?.replace(/[<>&;?#,'"$]+/g, encode)
.replace(/\.|\/\/:/g, '<span>$&</span>'); ?.replace(/\.|\/\/:/g, '<span>$&</span>');
}; };

Loading…
Cancel
Save