mirror of
https://github.com/kiwix/kiwix-tools.git
synced 2025-09-22 11:22:38 -04:00
+ fix
This commit is contained in:
parent
474c4e9a7a
commit
8c3d009115
@ -150,7 +150,7 @@ static int accessHandlerCallback(void *cls,
|
|||||||
string mimeType = "";
|
string mimeType = "";
|
||||||
unsigned int contentLength = 0;
|
unsigned int contentLength = 0;
|
||||||
|
|
||||||
if (!strcmp(url, "/search")) {
|
if (!strcmp(url, "/search") && hasSearchIndex) {
|
||||||
const char* pattern = MHD_lookup_connection_value(connection, MHD_GET_ARGUMENT_KIND, "pattern");
|
const char* pattern = MHD_lookup_connection_value(connection, MHD_GET_ARGUMENT_KIND, "pattern");
|
||||||
std::string urlStr;
|
std::string urlStr;
|
||||||
std::string titleStr;
|
std::string titleStr;
|
||||||
@ -195,7 +195,7 @@ static int accessHandlerCallback(void *cls,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Rewrite the content (add the search box) */
|
/* Rewrite the content (add the search box) */
|
||||||
if (mimeType == "text/html") {
|
if (hasSearchIndex && mimeType == "text/html") {
|
||||||
appendToFirstOccurence(content, "<head>", HTMLScripts);
|
appendToFirstOccurence(content, "<head>", HTMLScripts);
|
||||||
appendToFirstOccurence(content, "<body[^>]*>", HTMLDiv);
|
appendToFirstOccurence(content, "<body[^>]*>", HTMLDiv);
|
||||||
contentLength = content.size();
|
contentLength = content.size();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user