mirror of https://github.com/kiwix/libkiwix.git
+ Fix code in ZIM reader class breaking DOM integrity
This commit is contained in:
parent
17724fe70b
commit
d6d7274b0f
|
@ -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>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue