浏览代码

fix(web-search): use pattern instead of regex

Closes #12202
Carlo Sala 1 年之前
父节点
当前提交
43613d7b71
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      plugins/web-search/web-search.plugin.zsh

+ 1 - 1
plugins/web-search/web-search.plugin.zsh

@@ -44,7 +44,7 @@ function web_search() {
     # if search goes in the query string ==> space as +, otherwise %20
     # see https://stackoverflow.com/questions/1634271/url-encoding-the-space-character-or-20
     local param="-P"
-    [[ "$urls[$1]" =~ .*\?.*=$ ]] && param=""
+    [[ "$urls[$1]" == *\?*= ]] && param=""
 
     # build search url:
     # join arguments passed with '+', then append to search engine URL