mirror of https://github.com/kiwix/libkiwix.git
Merge branch 'master' of ssh://git.code.sf.net/p/kiwix/kiwix
This commit is contained in:
commit
05dc41157c
|
@ -512,7 +512,10 @@ namespace kiwix {
|
||||||
if (ok == true && !publisher.empty() && itr->publisher != publisher)
|
if (ok == true && !publisher.empty() && itr->publisher != publisher)
|
||||||
ok = false;
|
ok = false;
|
||||||
|
|
||||||
if ((ok == true && !search.empty()) && !(matchRegex(itr->title, search) || matchRegex(itr->description, search)))
|
if ((ok == true && !search.empty()) && !(matchRegex(itr->title, "\\Q" + search + "\\E") ||
|
||||||
|
matchRegex(itr->description, "\\Q" + search + "\\E") ||
|
||||||
|
matchRegex(itr->language, "\\Q" + search + "\\E")
|
||||||
|
))
|
||||||
ok = false;
|
ok = false;
|
||||||
|
|
||||||
if (ok == true) {
|
if (ok == true) {
|
||||||
|
|
|
@ -421,14 +421,21 @@ namespace kiwix {
|
||||||
article = article.getRedirectArticle();
|
article = article.getRedirectArticle();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (loopCounter < 42) {
|
||||||
/* Compute base url (might be different from the url if redirects */
|
/* Compute base url (might be different from the url if redirects */
|
||||||
baseUrl = "/" + std::string(1, article.getNamespace()) + "/" + article.getUrl();
|
baseUrl = "/" + std::string(1, article.getNamespace()) + "/" + article.getUrl();
|
||||||
|
|
||||||
/* Get the content mime-type */
|
/* Get the content mime-type */
|
||||||
|
try {
|
||||||
contentType = string(article.getMimeType().data(), article.getMimeType().size());
|
contentType = string(article.getMimeType().data(), article.getMimeType().size());
|
||||||
|
} catch (exception &e) {
|
||||||
|
cerr << "Unable to get the mimetype for "<< baseUrl<< ":" << e.what() << endl;
|
||||||
|
contentType = "application/octet-stream";
|
||||||
|
}
|
||||||
|
|
||||||
/* Get the data */
|
/* Get the data */
|
||||||
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.find("text/html") != string::npos &&
|
if (contentType.find("text/html") != string::npos &&
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -33,8 +33,6 @@ void kiwix::loadICUExternalTables() {
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef __ANDROID__
|
|
||||||
|
|
||||||
/* Prepare integer for display */
|
/* Prepare integer for display */
|
||||||
std::string kiwix::beautifyInteger(const unsigned int number) {
|
std::string kiwix::beautifyInteger(const unsigned int number) {
|
||||||
std::stringstream numberStream;
|
std::stringstream numberStream;
|
||||||
|
@ -143,8 +141,6 @@ std::string kiwix::urlEncode(const std::string &c) {
|
||||||
return escaped;
|
return escaped;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static char charFromHex(std::string a) {
|
static char charFromHex(std::string a) {
|
||||||
std::istringstream Blat(a);
|
std::istringstream Blat(a);
|
||||||
int Z;
|
int Z;
|
||||||
|
|
|
@ -39,8 +39,6 @@
|
||||||
|
|
||||||
namespace kiwix {
|
namespace kiwix {
|
||||||
|
|
||||||
#ifndef __ANDROID__
|
|
||||||
|
|
||||||
std::string removeAccents(const std::string &text);
|
std::string removeAccents(const std::string &text);
|
||||||
std::string beautifyInteger(const unsigned int number);
|
std::string beautifyInteger(const unsigned int number);
|
||||||
std::string beautifyFileSize(const unsigned int number);
|
std::string beautifyFileSize(const unsigned int number);
|
||||||
|
@ -49,8 +47,6 @@ namespace kiwix {
|
||||||
void printStringInHexadecimal(UnicodeString s);
|
void printStringInHexadecimal(UnicodeString s);
|
||||||
void stringReplacement(std::string& str, const std::string& oldStr, const std::string& newStr);
|
void stringReplacement(std::string& str, const std::string& oldStr, const std::string& newStr);
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void loadICUExternalTables();
|
void loadICUExternalTables();
|
||||||
std::string urlDecode(const std::string &c);
|
std::string urlDecode(const std::string &c);
|
||||||
|
|
||||||
|
|
|
@ -2,10 +2,10 @@
|
||||||
<link type="text/css" href="/skin/jquery-ui/jquery-ui.theme.min.css" rel="Stylesheet" />
|
<link type="text/css" href="/skin/jquery-ui/jquery-ui.theme.min.css" rel="Stylesheet" />
|
||||||
<span class="kiwix">
|
<span class="kiwix">
|
||||||
<span id="kiwixtoolbar" class="ui-widget-header">
|
<span id="kiwixtoolbar" class="ui-widget-header">
|
||||||
<form action="/" method="GET"><input type="submit" value="Library" id="kiwixlibrary" /></form>
|
<form action="/" method="GET" style="float: left; font-size: 1em !important; height: 1px;"><input type="submit" value="Library" id="kiwixlibrary" /></form>
|
||||||
<form action="/__CONTENT__/" method="GET"><input type="submit" value="Home" id="kiwixhome" /></form>
|
<form action="/__CONTENT__/" method="GET" style="float: left; font-size: 1em !important; height: 1px;"><input type="submit" value="Home" id="kiwixhome" /></form>
|
||||||
<form action="/random" method="GET"><input type="submit" value="Random" id="kiwixrandom" /><input type="hidden" name="content" value="__CONTENT__" /></form>
|
<form action="/random" method="GET" style="float: left; font-size: 1em !important; height: 1px;"><input type="submit" value="Random" id="kiwixrandom" /><input type="hidden" name="content" value="__CONTENT__" /></form>
|
||||||
<form method="GET" action="/search" id="kiwixsearchform"><input type="hidden" name="content" value="__CONTENT__" /><input type="submit" id="kiwixsearch" value="Search" /><input type="text" id="kiwixsearchbox" name="pattern" /></form>
|
<form method="GET" action="/search" id="kiwixsearchform" style="font-size: 1em !important; height: 1px; "><input type="hidden" name="content" value="__CONTENT__" /><input type="submit" id="kiwixsearch" value="Search" /><input type="text" id="kiwixsearchbox" name="pattern" /></form>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
<div style="display: block; height: 35px;"></div>
|
<div style="display: block; height: 35px;"></div>
|
||||||
|
|
Loading…
Reference in New Issue