Fix: sidebar search url issue (#3557)

Fixed https://github.com/ColorlibHQ/AdminLTE/issues/3556
This commit is contained in:
Daniel 2021-04-07 04:35:07 +05:30 committed by GitHub
parent 21a73f1991
commit c434c98aa8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -101,7 +101,7 @@ class SidebarSearch {
this._addNotFound()
} else {
endResults.each((i, result) => {
$(SELECTOR_SEARCH_RESULTS_GROUP).append(this._renderItem(escape(result.name), escape(result.link), result.path))
$(SELECTOR_SEARCH_RESULTS_GROUP).append(this._renderItem(escape(result.name), encodeURI(result.link), result.path))
})
}
@ -161,6 +161,7 @@ class SidebarSearch {
_renderItem(name, link, path) {
path = path.join(` ${this.options.arrowSign} `)
name = unescape(name)
link = decodeURI(link)
if (this.options.highlightName || this.options.highlightPath) {
const searchValue = $(SELECTOR_SEARCH_INPUT).val().toLowerCase()