fix: encode thumbnail URL

If it contains space the URL won't load

(cherry picked from commit 30039e8e62)
This commit is contained in:
Ankush Menat
2022-08-31 15:38:05 +05:30
committed by Mergify
parent 9ac973fff6
commit 7ff97794f4

View File

@@ -221,7 +221,7 @@ erpnext.ProductSearch = class {
let thumbnail = res.thumbnail || "/assets/erpnext/images/ui-states/cart-empty-state.png";
html += `
<div class="dropdown-item" style="display: flex;">
<img class="item-thumb col-2" src=${thumbnail} />
<img class="item-thumb col-2" src=${encodeURI(thumbnail)} />
<div class="col-9" style="white-space: normal;">
<a href="/${res.route}">${res.web_item_name}</a><br>
<span class="brand-line">${res.brand ? "by " + res.brand : ""}</span>