feat(platform-browser): Allow `sms`-URLs (#31463)

sms ulr is already supported by google/closure-library and and validations are added to check
if the body passed is safe or not you can refer bb7ea65319/closure/goog/html/safeurl.js (L440-L454) for more details

Fixes #31462

PR Close #31463
This commit is contained in:
Santosh Yadav 2020-06-25 07:01:32 +05:30 committed by Andrew Kushnir
parent 0879d2e85d
commit fc5c34d1b8
1 changed files with 1 additions and 1 deletions

View File

@ -34,7 +34,7 @@ import {isDevMode} from '../util/is_dev_mode';
* *
* This regular expression was taken from the Closure sanitization library. * This regular expression was taken from the Closure sanitization library.
*/ */
const SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi; const SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file|sms):|[^&:/?#]*(?:[/?#]|$))/gi;
/* A pattern that matches safe srcset values */ /* A pattern that matches safe srcset values */
const SAFE_SRCSET_PATTERN = /^(?:(?:https?|file):|[^&:/?#]*(?:[/?#]|$))/gi; const SAFE_SRCSET_PATTERN = /^(?:(?:https?|file):|[^&:/?#]*(?:[/?#]|$))/gi;