From e1d9c13b26aae0c41a0f5e8bb5ff72b6633a4752 Mon Sep 17 00:00:00 2001 From: mapi68 <41143572+mapi68@users.noreply.github.com> Date: Sat, 25 Apr 2026 18:47:41 +0200 Subject: [PATCH] URL-encode spaces as %20 in picon HTTP request URLs When fetching picons from the web interface, channel names containing spaces were used as-is in the HTTP URL, causing 400 Bad Request errors. URL-encode spaces as %20 in both code paths: - Channel::CreateIconPath() (UseOnlinePicons without OpenWebIf path) - Channels::LoadChannelsExtraData() (UseOpenWebIfPiconPath) - Bump version to 22.3.6 and add changelog entry --- pvr.vuplus/addon.xml.in | 2 +- pvr.vuplus/changelog.txt | 3 +++ src/enigma2/Channels.cpp | 4 +++- src/enigma2/data/Channel.cpp | 6 +++++- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/pvr.vuplus/addon.xml.in b/pvr.vuplus/addon.xml.in index e8d23bd7..32daa2f3 100644 --- a/pvr.vuplus/addon.xml.in +++ b/pvr.vuplus/addon.xml.in @@ -1,7 +1,7 @@ @ADDON_DEPENDS@ diff --git a/pvr.vuplus/changelog.txt b/pvr.vuplus/changelog.txt index 36d1c228..5c0173a1 100644 --- a/pvr.vuplus/changelog.txt +++ b/pvr.vuplus/changelog.txt @@ -1,3 +1,6 @@ +v22.3.6 +- Fix picon HTTP requests failing with 400 Bad Request when channel names contain spaces (URL-encode spaces as %20) + v22.3.4 - Translations updates from Weblate - af_za, am_et, ar_sa, ast_es, az_az, be_by, bg_bg, bs_ba, ca_es, cs_cz, cy_gb, da_dk, de_de, el_gr, en_au, en_nz, en_us, eo, es_ar, es_es, es_mx, et_ee, eu_es, fa_af, fa_ir, fi_fi, fo_fo, fr_ca, fr_fr, gl_es, he_il, hi_in, hr_hr, hu_hu, hy_am, id_id, is_is, it_it, ja_jp, ko_kr, lt_lt, lv_lv, mi, mk_mk, ml_in, mn_mn, ms_my, mt_mt, my_mm, nb_no, nl_nl, pl_pl, prs, pt_br, pt_pt, ro_ro, ru_ru, si_lk, sk_sk, sl_si, sq_al, sr_rs, sr_rs@latin, sv_se, szl, ta_in, te_in, tg_tj, th_th, tr_tr, uk_ua, uz_uz, vi_vn, zh_cn, zh_tw diff --git a/src/enigma2/Channels.cpp b/src/enigma2/Channels.cpp index a72e6006..f49a77c8 100644 --- a/src/enigma2/Channels.cpp +++ b/src/enigma2/Channels.cpp @@ -345,7 +345,9 @@ int Channels::LoadChannelsExtraData(const std::shared_ptrGetConnectionURL(); connectionURL = connectionURL.substr(0, connectionURL.size() - 1); - channel->SetIconPath(StringUtils::Format("%s%s", connectionURL.c_str(), jsonChannel["picon"].get().c_str())); + std::string piconPath = jsonChannel["picon"].get(); + StringUtils::Replace(piconPath, " ", "%20"); + channel->SetIconPath(StringUtils::Format("%s%s", connectionURL.c_str(), piconPath.c_str())); Logger::Log(LEVEL_DEBUG, "%s For Channel %s, using OpenWebPiconPath: %s", __func__, jsonChannel["servicename"].get().c_str(), channel->GetIconPath().c_str()); } diff --git a/src/enigma2/data/Channel.cpp b/src/enigma2/data/Channel.cpp index 5611c279..3978856e 100644 --- a/src/enigma2/data/Channel.cpp +++ b/src/enigma2/data/Channel.cpp @@ -181,7 +181,11 @@ std::string Channel::CreateIconPath(const std::string& commonServiceReference) std::replace(iconPath.begin(), iconPath.end(), ':', '_'); if (m_settings->UseOnlinePicons()) - iconPath = StringUtils::Format("%spicon/%s.png", m_settings->GetConnectionURL().c_str(), iconPath.c_str()); + { + std::string encodedPath = iconPath; + StringUtils::Replace(encodedPath, " ", "%20"); + iconPath = StringUtils::Format("%spicon/%s.png", m_settings->GetConnectionURL().c_str(), encodedPath.c_str()); + } else iconPath = m_settings->GetIconPath().c_str() + iconPath + ".png";