diff --git a/src/ng/sce.js b/src/ng/sce.js index d3553bde7c45..c3998949d2d8 100644 --- a/src/ng/sce.js +++ b/src/ng/sce.js @@ -36,8 +36,8 @@ function adjustMatcher(matcher) { 'Illegal sequence *** in string matcher. String: {0}', matcher); } matcher = escapeForRegexp(matcher). - replace('\\*\\*', '.*'). - replace('\\*', '[^:/.?&;]*'); + replace(/\\\*\\\*/g, '.*'). + replace(/\\\*/g, '[^:/.?&;]*'); return new RegExp('^' + matcher + '$'); } else if (isRegExp(matcher)) { // The only other type of matcher allowed is a Regexp. diff --git a/test/ng/sceSpecs.js b/test/ng/sceSpecs.js index d3f00d9a010b..12e1597cd03c 100644 --- a/test/ng/sceSpecs.js +++ b/test/ng/sceSpecs.js @@ -316,6 +316,10 @@ describe('SCE', function() { expect(adjustMatcher(/^a.*b$/).exec('a.b')).not.toBeNull(); expect(adjustMatcher(/^a.*b$/).exec('-a.b-')).toBeNull(); }); + + it('should should match * and **', function() { + expect(adjustMatcher('*://*.example.com/**').exec('http://www.example.com/path')).not.toBeNull(); + }); }); describe('regex matcher', function() {