Use encodeURIComponent for search queries

Should fix issue #244.
jh-changes
Olle Fredriksson 7 years ago committed by GitHub
parent 0b37c2250e
commit 86421b7586
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      src/shared/commands.js

@ -9,7 +9,7 @@ const normalizeUrl = (args, searchConfig) => {
if (concat.includes('.') && !concat.includes(' ')) { if (concat.includes('.') && !concat.includes(' ')) {
return 'http://' + concat; return 'http://' + concat;
} }
let query = encodeURI(concat); let query = concat;
let template = searchConfig.engines[ let template = searchConfig.engines[
searchConfig.default searchConfig.default
]; ];
@ -19,7 +19,7 @@ const normalizeUrl = (args, searchConfig) => {
template = searchConfig.engines[key]; template = searchConfig.engines[key];
} }
} }
return template.replace('{}', query); return template.replace('{}', encodeURIComponent(query));
} }
}; };