From c0415f3154a05a83b83ea2d5ef0b7cea270d0df2 Mon Sep 17 00:00:00 2001 From: Can Cellek Date: Fri, 19 Jan 2024 18:05:07 +0300 Subject: [PATCH] Fix URL Encoding for search buffer (#69) Fixes #69 * Fix URL Encoding for search buffer * Bump version number --- package.json | 2 +- src/utils/command.js | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 745240a1..e160cfe1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "start-page", - "version": "3.1.1", + "version": "3.1.2", "private": true, "scripts": { "dev": "next dev", diff --git a/src/utils/command.js b/src/utils/command.js index 8419a48e..62ea8da3 100644 --- a/src/utils/command.js +++ b/src/utils/command.js @@ -49,7 +49,9 @@ function openFilteredLinks(command, settings) { export function DefaultSearch(buffer, settings) { const defaultSerachEngine = settings.search.default const target = settings.search.target - openLink(defaultSerachEngine + buffer, target) + + const encodedBuffer = encodeURIComponent(buffer) + openLink(defaultSerachEngine + encodedBuffer, target) } function tryParseSearchShortcut(command, settings) { @@ -67,7 +69,9 @@ function tryParseSearchShortcut(command, settings) { if (name === regex_cmd[1]) { const url = commandData.url - openLink(url.replace("{}", regex_cmd[2]), settings.urlLaunch.target) + + const encodedBuffer = encodeURIComponent(regex_cmd[2]) + openLink(url.replace("{}", encodedBuffer, settings.urlLaunch.target)) return true } }