diff options
| author | Stephen Blott | 2018-02-24 07:44:32 +0000 |
|---|---|---|
| committer | GitHub | 2018-02-24 07:44:32 +0000 |
| commit | 011c8991184f10839d7afa1ff8d7bfad0d6bd968 (patch) | |
| tree | 775be2452937d2422b989196d69ab3f2ae505cfb | |
| parent | bef8788805bc3e09de432f8642b54fccf3591947 (diff) | |
| parent | 17425d7187a96f8f7cdd15723f21220733e64c78 (diff) | |
| download | vimium-011c8991184f10839d7afa1ff8d7bfad0d6bd968.tar.bz2 | |
Merge pull request #2968 from smblott-github/fix-2967
Escape [ and ] in hostname in popup.
| -rw-r--r-- | pages/options.coffee | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/pages/options.coffee b/pages/options.coffee index 74eedc39..c3e6c3be 100644 --- a/pages/options.coffee +++ b/pages/options.coffee @@ -181,7 +181,9 @@ class ExclusionRulesOnPopupOption extends ExclusionRulesOption if /^https?:\/\/./.test @url # The common use case is to disable Vimium at the domain level. # Generate "https?://www.example.com/*" from "http://www.example.com/path/to/page.html". - "https?:/" + @url.split("/",3)[1..].join("/") + "/*" + # Note: IPV6 host addresses will contain "[" and "]" (which must be escaped). + hostname = @url.split("/",3)[1..].join("/").replace("[", "\\[").replace "]", "\\]" + "https?:/" + hostname + "/*" else if /^[a-z]{3,}:\/\/./.test @url # Anything else which seems to be a URL. @url.split("/",3).join("/") + "/*" |
