+ Fix code in ZIM reader class breaking DOM integrity

This commit is contained in:
kelson42 2014-07-19 19:29:51 +02:00
parent 17724fe70b
commit d6d7274b0f
1 changed files with 3 additions and 1 deletions

View File

@ -431,7 +431,9 @@ namespace kiwix {
content = string(article.getData().data(), article.getArticleSize()); content = string(article.getData().data(), article.getArticleSize());
/* Try to set a stub HTML header/footer if necesssary */ /* Try to set a stub HTML header/footer if necesssary */
if (contentType == "text/html" && std::string::npos == content.find("<body>")) { if (contentType.find("text/html") != string::npos &&
content.find("<body") == std::string::npos &&
content.find("<BODY") == std::string::npos) {
content = "<html><head><title>" + article.getTitle() + "</title><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" /></head><body>" + content + "</body></html>"; content = "<html><head><title>" + article.getTitle() + "</title><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" /></head><body>" + content + "</body></html>";
} }