diff options
author | Olle Fredriksson <fredriksson.olle@gmail.com> | 2017-11-26 12:02:08 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-26 12:02:08 +0100 |
commit | 86421b75867a48bfb8930c4b5ddf1292a63726c3 (patch) | |
tree | 16f18b1cd9c0c2b0c91ed99bfa135a05b30f25cf /src/shared/commands.js | |
parent | 0b37c2250e21e8c40c2c5e9abfe51903458cc94d (diff) |
Use encodeURIComponent for search queries
Should fix issue #244.
Diffstat (limited to 'src/shared/commands.js')
-rw-r--r-- | src/shared/commands.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/shared/commands.js b/src/shared/commands.js index 8edeb5c..ed64a63 100644 --- a/src/shared/commands.js +++ b/src/shared/commands.js @@ -9,7 +9,7 @@ const normalizeUrl = (args, searchConfig) => { if (concat.includes('.') && !concat.includes(' ')) { return 'http://' + concat; } - let query = encodeURI(concat); + let query = concat; let template = searchConfig.engines[ searchConfig.default ]; @@ -19,7 +19,7 @@ const normalizeUrl = (args, searchConfig) => { template = searchConfig.engines[key]; } } - return template.replace('{}', query); + return template.replace('{}', encodeURIComponent(query)); } }; |