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

fix(sce) IE 7 standards mode not supported #3646

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/ng/sce.js
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@ function $SceProvider() {
// the "expression(javascript expression)" syntax which is insecure.
if (enabled && msie) {
var documentMode = $document[0].documentMode;
if (documentMode !== undefined && documentMode < 8) {
if (documentMode !== undefined && documentMode < 7) {
throw $sceMinErr('iequirks',
'Strict Contextual Escaping does not support Internet Explorer version < 9 in quirks ' +
'mode. You can fix this by adding the text <!doctype html> to the top of your HTML ' +
Expand Down
10 changes: 9 additions & 1 deletion test/ng/sceSpecs.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,11 @@ describe('SCE', function() {
}

it('should throw an exception when sce is enabled in quirks mode', function() {
runTest(true, 7, true);
runTest(true, 5, true);
});

it('should NOT throw an exception when sce is enabled and in IE7 standards mode', function() {
runTest(true, 7, false);
});

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

it('should NOT throw an exception when sce is disabled even when in quirks mode', function() {
runTest(false, 5, false);
});

it('should NOT throw an exception when sce is disabled and in IE7 standards mode', function() {
runTest(false, 7, false);
});

Expand Down