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