Server : LiteSpeed System : Linux server321.web-hosting.com 4.18.0-513.18.1.lve.el8.x86_64 #1 SMP Thu Feb 22 12:55:50 UTC 2024 x86_64 User : apotdzgr ( 7060) PHP Version : 8.0.30 Disable Function : NONE Directory : /home/apotdzgr/snelapotheeks.com/wp-content/plugins/extendify/src/Shared/utils/ |
Upload File : |
export const sanitizeString = (value) => { if (!value) return ''; const DISALLOWED_TAGS = [ 'script', 'iframe', 'object', 'embed', 'form', 'meta', 'link', 'style', 'svg', ]; const DISALLOWED_PATTERNS = [ `<\\/*\\s*(${DISALLOWED_TAGS.join('|')})\\b[^>]*>`, 'javascript:', 'data:', ]; let sanitizedValue = value.trim(); DISALLOWED_PATTERNS.forEach((pattern) => { const patternRegex = new RegExp(pattern, 'gi'); sanitizedValue = sanitizedValue.replace(patternRegex, ''); }); return sanitizedValue; };