diff options
author | XhmikosR <xhmikosr@gmail.com> | 2021-09-29 07:41:06 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-29 07:41:06 +0300 |
commit | 759fc89f4bfa7586b97888954e8993fdb4130240 (patch) | |
tree | a4279489f11f010ca0db2ae5e79f2e050cb5df7e /js/src | |
parent | 9437973e58ffc3a45fcb28f92144278064c62ca4 (diff) |
sanitizer: add `sms` in the `SAFE_URL_PATTERN` (#35074)
Diffstat (limited to 'js/src')
-rw-r--r-- | js/src/util/sanitizer.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/js/src/util/sanitizer.js b/js/src/util/sanitizer.js index 11b28a9d9d..17b925a8cc 100644 --- a/js/src/util/sanitizer.js +++ b/js/src/util/sanitizer.js @@ -21,14 +21,14 @@ const ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i /** * A pattern that recognizes a commonly useful subset of URLs that are safe. * - * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts + * Shoutout to Angular https://github.com/angular/angular/blob/12.2.x/packages/core/src/sanitization/url_sanitizer.ts */ -const SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^#&/:?]*(?:[#/?]|$))/i +const SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file|sms):|[^#&/:?]*(?:[#/?]|$))/i /** * 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 + * Shoutout to Angular https://github.com/angular/angular/blob/12.2.x/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,[\d+/a-z]+=*$/i |