From 8c3d00911515c26c732de0c045836b4298234b7b Mon Sep 17 00:00:00 2001 From: kelson42 Date: Sat, 23 Jan 2010 15:22:46 +0000 Subject: [PATCH] + fix --- src/server/kiwix-serve.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/kiwix-serve.cpp b/src/server/kiwix-serve.cpp index 415d1f3..5a5c3a5 100644 --- a/src/server/kiwix-serve.cpp +++ b/src/server/kiwix-serve.cpp @@ -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, "", HTMLScripts); appendToFirstOccurence(content, "]*>", HTMLDiv); contentLength = content.size();