From 7fa049f4df6f052f0a836a21c6f6e3aa1465a4f0 Mon Sep 17 00:00:00 2001 From: Simon Legner Date: Thu, 4 Jun 2020 09:21:18 +0200 Subject: [PATCH] sanitizeUri: allow geo URI https://tools.ietf.org/html/rfc5870 --- src/ng/sanitizeUri.js | 2 +- test/ngSanitize/sanitizeSpec.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ng/sanitizeUri.js b/src/ng/sanitizeUri.js index edda8244e406..1115f6224ab1 100644 --- a/src/ng/sanitizeUri.js +++ b/src/ng/sanitizeUri.js @@ -7,7 +7,7 @@ */ function $$SanitizeUriProvider() { - var aHrefSanitizationWhitelist = /^\s*(https?|s?ftp|mailto|tel|file):/, + var aHrefSanitizationWhitelist = /^\s*(https?|s?ftp|mailto|tel|file|geo):/, imgSrcSanitizationWhitelist = /^\s*((https?|ftp|file|blob):|data:image\/)/; /** diff --git a/test/ngSanitize/sanitizeSpec.js b/test/ngSanitize/sanitizeSpec.js index ac3c44b3d59c..554ef5677258 100644 --- a/test/ngSanitize/sanitizeSpec.js +++ b/test/ngSanitize/sanitizeSpec.js @@ -589,6 +589,7 @@ describe('HTML', function() { expect('MAILTO:me@example.com').toBeValidUrl(); expect('tel:123-123-1234').toBeValidUrl(); expect('TEL:123-123-1234').toBeValidUrl(); + expect('geo:12.34,56.78').toBeValidUrl(); expect('#anchor').toBeValidUrl(); expect('/page1.md').toBeValidUrl(); });