Skip to content

Commit 637c9b1

Browse files
justinrknowlesIgorMinar
authored andcommitted
fix($sce): allow IE7 standards mode to pass non-quirks mode test
Changes documentMode test version to 7 in order to support IE 8 in IE 7 standards mode while still protecting against quirks mode. documentMode returns the following values: 5 - quirks mode, 7 - IE 7 standards mode, 8 - IE 8 standards mode. Closes angular#3633 Closes angular#3646
1 parent ad77d67 commit 637c9b1

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/ng/sce.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,7 @@ function $SceProvider() {
620620
// the "expression(javascript expression)" syntax which is insecure.
621621
if (enabled && msie) {
622622
var documentMode = $document[0].documentMode;
623-
if (documentMode !== undefined && documentMode < 8) {
623+
if (documentMode !== undefined && documentMode < 7) {
624624
throw $sceMinErr('iequirks',
625625
'Strict Contextual Escaping does not support Internet Explorer version < 9 in quirks ' +
626626
'mode. You can fix this by adding the text <!doctype html> to the top of your HTML ' +

test/ng/sceSpecs.js

+9-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,11 @@ describe('SCE', function() {
5858
}
5959

6060
it('should throw an exception when sce is enabled in quirks mode', function() {
61-
runTest(true, 7, true);
61+
runTest(true, 5, true);
62+
});
63+
64+
it('should NOT throw an exception when sce is enabled and in IE7 standards mode', function() {
65+
runTest(true, 7, false);
6266
});
6367

6468
it('should NOT throw an exception when sce is enabled and in standards mode', function() {
@@ -70,6 +74,10 @@ describe('SCE', function() {
7074
});
7175

7276
it('should NOT throw an exception when sce is disabled even when in quirks mode', function() {
77+
runTest(false, 5, false);
78+
});
79+
80+
it('should NOT throw an exception when sce is disabled and in IE7 standards mode', function() {
7381
runTest(false, 7, false);
7482
});
7583

0 commit comments

Comments
 (0)