Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Bootstrap
bootstrap
Commits
6d0fd8c3
Commit
6d0fd8c3
authored
3 years ago
by
XhmikosR
Browse files
Options
Download
Email Patches
Plain Diff
Backport #35074
sanitizer: add `sms` in the `SAFE_URL_PATTERN`
parent
7b3a47ee
v4-dev-dropdown-hide-method
v4-dev
v4.6.2
v4.6.1
1 merge request
!36532
My v4 dev
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
js/src/tools/sanitizer.js
+3
-3
js/src/tools/sanitizer.js
with
3 additions
and
3 deletions
+3
-3
js/src/tools/sanitizer.js
+
3
-
3
View file @
6d0fd8c3
...
@@ -55,14 +55,14 @@ export const DefaultWhitelist = {
...
@@ -55,14 +55,14 @@ export const DefaultWhitelist = {
/**
/**
* A pattern that recognizes a commonly useful subset of URLs that are safe.
* 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.
* 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
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
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets