From a0c16a64ecee98682d0de7f2d84e5114bfcc82bc Mon Sep 17 00:00:00 2001 From: Dylan G <1565516+Helloman892@users.noreply.github.com> Date: Mon, 30 May 2022 12:04:18 +0100 Subject: [PATCH] Search strings now escaped properly (fixes #267) --- source/remote.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/source/remote.c b/source/remote.c index 3950acb..8145002 100644 --- a/source/remote.c +++ b/source/remote.c @@ -31,6 +31,7 @@ #include "fs.h" #include "unicode.h" #include "music.h" +#include "urls.h" static Instructions_s browser_instructions[MODE_AMOUNT] = { { @@ -436,18 +437,11 @@ static void search_menu(Entry_List_s * list) if (button == SWKBD_BUTTON_CONFIRM) { free(list->tp_search); - for (unsigned int i = 0; i < strlen(search); i++) - { - if (search[i] == ' ') - search[i] = '+'; - } - list->tp_search = search; + list->tp_search = url_escape(search); + DEBUG("Search escaped: %s -> %s\n", search, list->tp_search); load_remote_list(list, 1, list->mode, false); } - else - { - free(search); - } + free(search); } static void change_selected(Entry_List_s * list, int change_value)