Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 2ec8d1f

Browse files
committed
fix(linky): encode all double quotes when serializing email addresses
When encoding a URL or an email address, then escape all double quotes Closes #10090
1 parent 08cd5c1 commit 2ec8d1f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/ngSanitize/filter/linky.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ angular.module('ngSanitize').filter('linky', ['$sanitize', function($sanitize) {
142142
'" ');
143143
}
144144
html.push('href="',
145-
url.replace('"', '"'),
145+
url.replace(/"/g, '"'),
146146
'">');
147147
addText(text);
148148
html.push('</a>');

test/ngSanitize/filter/linkySpec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ describe('linky', function() {
3030
});
3131

3232
it('should handle quotes in the email', function() {
33-
expect(linky('foo@"bar.com')).toEqual('<a href="mailto:foo@&#34;bar.com">foo@&#34;bar.com</a>');
33+
expect(linky('foo@"bar".com')).toEqual('<a href="mailto:foo@&#34;bar&#34;.com">foo@&#34;bar&#34;.com</a>');
3434
});
3535

3636
it('should handle target:', function() {

0 commit comments

Comments
 (0)