code review: disregard case sensitivity

This commit is contained in:
Raymond Hill 2017-12-29 21:29:57 -05:00
parent 93e76ecf5d
commit 3ec9377c3e
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
1 changed files with 9 additions and 9 deletions

View File

@ -614,16 +614,16 @@ var filterDocument = (function() {
if ( b === 0x3C /* '<' */ ) { break; }
if ( b > 0x20 || b > 0x7F || i > 240 ) { return false; }
}
// Test for '!DOCTYPE'
// Case insensitively test for '!doctype'.
if (
bb[i++] !== 0x21 /* '!' */ ||
bb[i++] !== 0x44 /* 'D' */ ||
bb[i++] !== 0x4F /* 'O' */ ||
bb[i++] !== 0x43 /* 'C' */ ||
bb[i++] !== 0x54 /* 'T' */ ||
bb[i++] !== 0x59 /* 'Y' */ ||
bb[i++] !== 0x50 /* 'P' */ ||
bb[i++] !== 0x45 /* 'E' */
bb[i++] !== 0x21 /* '!' */ ||
( bb[i++] | 0x20 ) !== 0x64 /* 'd' */ ||
( bb[i++] | 0x20 ) !== 0x6F /* 'o' */ ||
( bb[i++] | 0x20 ) !== 0x63 /* 'c' */ ||
( bb[i++] | 0x20 ) !== 0x74 /* 't' */ ||
( bb[i++] | 0x20 ) !== 0x79 /* 'y' */ ||
( bb[i++] | 0x20 ) !== 0x70 /* 'p' */ ||
( bb[i++] | 0x20 ) !== 0x65 /* 'e' */
) {
return false;
}