mirror of
https://github.com/kiwix/kiwix-tools.git
synced 2025-09-23 03:52:35 -04:00
escape the & character of humanReadableBookId to not be interpreted in urls as a new argument
This commit is contained in:
parent
573b826861
commit
894ed12f37
@ -162,9 +162,7 @@ void introduceTaskbar(string& content, const string& humanReadableBookId)
|
||||
content = appendToFirstOccurence(
|
||||
content,
|
||||
"<head>",
|
||||
replaceRegex(
|
||||
RESOURCE::include_html_part, humanReadableBookId, "__CONTENT__")
|
||||
+ (noLibraryButtonFlag
|
||||
RESOURCE::include_html_part + (noLibraryButtonFlag
|
||||
? "<style>#kiwix_serve_taskbar_library_button { display: none }</style>"
|
||||
: "")
|
||||
);
|
||||
@ -183,6 +181,7 @@ void introduceTaskbar(string& content, const string& humanReadableBookId)
|
||||
"__CONTENT__"));
|
||||
}
|
||||
content = replaceRegex(content, rootLocation, "__ROOT_LOCATION__");
|
||||
content = replaceRegex(content,replaceRegex(humanReadableBookId, "%26", "&"), "__CONTENT_ESCAPE__");
|
||||
}
|
||||
pthread_mutex_unlock(®exLock);
|
||||
}
|
||||
|
@ -8,7 +8,7 @@
|
||||
jk(function() {
|
||||
jk( "#kiwixsearchbox" ).autocomplete({
|
||||
|
||||
source: "__ROOT_LOCATION__/suggest?content=__CONTENT__",
|
||||
source: "__ROOT_LOCATION__/suggest?content=__CONTENT_ESCAPE__",
|
||||
dataType: "json",
|
||||
cache: false,
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
<div class="kiwix_button_wrapper">
|
||||
<a id="kiwix_serve_taskbar_library_button" href="__ROOT_LOCATION__/"><button>Library</button></a>
|
||||
<a id="kiwix_serve_taskbar_home_button" href="__ROOT_LOCATION__/__CONTENT__/"><button>Home</button></a>
|
||||
<a id="kiwix_serve_taskbar_random_button" href="__ROOT_LOCATION__/random?content=__CONTENT__"><button>Random</button></a>
|
||||
<a id="kiwix_serve_taskbar_random_button" href="__ROOT_LOCATION__/random?content=__CONTENT_ESCAPE__"><button>Random</button></a>
|
||||
</div>
|
||||
<div class="kiwix_searchform">
|
||||
<form class="kiwixsearch" method="GET" action="__ROOT_LOCATION__/search" id="kiwixsearchform">
|
||||
|
Loading…
x
Reference in New Issue
Block a user