1
0
Fork 0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2024-11-25 15:20:08 +00:00

fix(web-search): URL-encode search parameters (#10910)

Fixes #10884
This commit is contained in:
jackh 2022-05-04 00:30:18 +08:00 committed by Marc Cornellà
parent 4674384d1a
commit 140c977a3d
No known key found for this signature in database
GPG key ID: 0314585E776A9C1B

View file

@ -35,7 +35,7 @@ function web_search() {
if [[ $# -gt 1 ]]; then
# build search url:
# join arguments passed with '+', then append to search engine URL
url="${urls[$1]}${(j:+:)@[2,-1]}"
url="${urls[$1]}$(omz_urlencode ${@[2,-1]})"
else
# build main page url:
# split by '/', then rejoin protocol (1) and domain (2) parts with '//'