Merge pull request #252 from ollef/patch-1

Use encodeURIComponent for search queries
jh-changes
Shin'ya Ueoka 7 years ago committed by GitHub
commit d5517345a8
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(' ')) {
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));
}
};