aboutsummaryrefslogtreecommitdiff
path: root/js/src
diff options
context:
space:
mode:
authorNikon the Third <[email protected]>2021-02-19 09:24:53 +0100
committerGitHub <[email protected]>2021-02-19 10:24:53 +0200
commite8f08d1802976b8200551de49354757f84e438cf (patch)
tree9b93206a442b98c147c1820179f8232bc7e565b6 /js/src
parent454d8ae1f4513109abeb5b82a015691be5e95f0b (diff)
downloadbootstrap-e8f08d1802976b8200551de49354757f84e438cf.tar.xz
bootstrap-e8f08d1802976b8200551de49354757f84e438cf.zip
Adjust regex `SAFE_URL_PATTERN` for use with test method of regexes. (#33136)
The test method on regexes behaves different than the match method on strings in the presence of the global modifier. Add a unit test for sanitizing the same template twice. Co-authored-by: XhmikosR <[email protected]>
Diffstat (limited to 'js/src')
-rw-r--r--js/src/util/sanitizer.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/js/src/util/sanitizer.js b/js/src/util/sanitizer.js
index 18ac6f943..57653a891 100644
--- a/js/src/util/sanitizer.js
+++ b/js/src/util/sanitizer.js
@@ -23,7 +23,7 @@ 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):|[^#&/:?]*(?:[#/?]|$))/i
/**
* A pattern that matches safe data URLs. Only matches image, video and audio types.