From d142527a8ebc23f800ad9c6df976ca49b447e31e Mon Sep 17 00:00:00 2001 From: Geoff McLane Date: Thu, 4 May 2017 17:36:39 +0200 Subject: [PATCH] Issue #338 - Deal with two other spurious access warnings --- src/access.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/access.c b/src/access.c index 7244492..ac3b9aa 100644 --- a/src/access.c +++ b/src/access.c @@ -2761,6 +2761,10 @@ static Bool CheckMetaData( TidyDocImpl* doc, Node* node, Bool HasMetaData ) TY_(ReportAccessError)( doc, node, REMOVE_AUTO_REDIRECT); } } + if (TY_(IsHTML5Mode)(doc) && attrIsCHARSET(av) && hasValue(av)) + { + ContainsAttr = yes; + } } if ( HasContent || HasHttpEquiv ) @@ -2840,9 +2844,17 @@ static void CheckDocType( TidyDocImpl* doc ) if (DTnode && DTnode->end != 0) { ctmbstr word = textFromOneNode( doc, DTnode); - if ((strstr (word, "HTML PUBLIC") == NULL) && - (strstr (word, "html PUBLIC") == NULL)) - DTnode = NULL; + if (TY_(IsHTML5Mode)(doc)) + { + if ((strstr(word, "HTML") == NULL) && + (strstr(word, "html") == NULL)) + DTnode = NULL; + } + else { + if ((strstr(word, "HTML PUBLIC") == NULL) && + (strstr(word, "html PUBLIC") == NULL)) + DTnode = NULL; + } } if (!DTnode) TY_(ReportAccessError)( doc, &doc->root, DOCTYPE_MISSING);