urlmon: Recognize <head> start tag as text/html MIME type.

This commit is contained in:
Nikolay Sivov 2012-01-29 23:33:04 +03:00 committed by Alexandre Julliard
parent e2264859c8
commit f2dfe86ac4
2 changed files with 22 additions and 8 deletions

View file

@ -563,6 +563,10 @@ static BYTE data83[] = {'.','s','n','d'};
static BYTE data84[] = {'.','s','n','d',0,'<','h','t','m','l','>',1,1};
static BYTE data85[] = {'.','S','N','D',0};
static BYTE data86[] = {0x49,0x49,0x2a,0xff};
static BYTE data87[] = {' ','<','h','e','a','d'};
static BYTE data88[] = {' ','<','h','e','a','d','>'};
static BYTE data89[] = {'\t','\r','<','h','e','a','d','>'};
static BYTE data90[] = {'<','H','e','A','d','>'};
static const struct {
BYTE *data;
@ -654,7 +658,11 @@ static const struct {
{data83, sizeof(data83), mimeTextPlain},
{data84, sizeof(data84), mimeTextHtml, mimeAudioBasic /* IE8 */},
{data85, sizeof(data85), mimeTextPlain},
{data86, sizeof(data86), mimeImageTiff, NULL, mimeTextPlain}
{data86, sizeof(data86), mimeImageTiff, NULL, mimeTextPlain},
{data87, sizeof(data87), mimeTextPlain},
{data88, sizeof(data88), mimeTextHtml, mimeTextPlain /* IE8 */},
{data89, sizeof(data89), mimeTextHtml, mimeTextPlain /* IE8 */},
{data90, sizeof(data90), mimeTextHtml, mimeTextPlain /* IE8 */}
};
static void test_FindMimeFromData(void)

View file

@ -566,13 +566,19 @@ static BOOL text_html_filter(const BYTE *b, DWORD size)
if(size < 5)
return FALSE;
for(i=0; i < size-5; i++) {
if(b[i] == '<'
&& (b[i+1] == 'h' || b[i+1] == 'H')
&& (b[i+2] == 't' || b[i+2] == 'T')
&& (b[i+3] == 'm' || b[i+3] == 'M')
&& (b[i+4] == 'l' || b[i+4] == 'L'))
return TRUE;
for(i = 0; i < size-5; i++) {
if((b[i] == '<'
&& (b[i+1] == 'h' || b[i+1] == 'H')
&& (b[i+2] == 't' || b[i+2] == 'T')
&& (b[i+3] == 'm' || b[i+3] == 'M')
&& (b[i+4] == 'l' || b[i+4] == 'L')) ||
((size - i >= 6)
&& b[i] == '<'
&& (b[i+1] == 'h' || b[i+1] == 'H')
&& (b[i+2] == 'e' || b[i+2] == 'E')
&& (b[i+3] == 'a' || b[i+3] == 'A')
&& (b[i+4] == 'd' || b[i+4] == 'D')
&& b[i+5] == '>')) return TRUE;
}
return FALSE;