diff options
author | XhmikosR <xhmikosr@gmail.com> | 2019-12-24 19:23:17 +0300 |
---|---|---|
committer | XhmikosR <xhmikosr@gmail.com> | 2020-01-07 23:25:50 +0300 |
commit | 5d1da6377df993319c77d6133eafd09a1c956990 (patch) | |
tree | ebff04abde53d9b165b4900e59c6a18da93bb687 /js | |
parent | 9ab79ac1fca751c74192aa6e7c05398c65465b31 (diff) |
Fix the new lint errors.
Diffstat (limited to 'js')
-rw-r--r-- | js/src/util/sanitizer.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/js/src/util/sanitizer.js b/js/src/util/sanitizer.js index 8f72d2005a..58caeb4864 100644 --- a/js/src/util/sanitizer.js +++ b/js/src/util/sanitizer.js @@ -25,14 +25,14 @@ const ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i * * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts */ -const SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi +const SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^#&/:?]*(?:[#/?]|$))/gi /** * A pattern that matches safe data URLs. Only matches image, video and audio types. * * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts */ -const DATA_URL_PATTERN = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i +const DATA_URL_PATTERN = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[\d+/a-z]+=*$/i const allowedAttribute = (attr, allowedAttributeList) => { const attrName = attr.nodeName.toLowerCase() |