Skip to content

Commit

Permalink
Fixes #6
Browse files Browse the repository at this point in the history
Open homepage only of it is a http(s) link
  • Loading branch information
ueffel committed Dec 15, 2018
1 parent 0bacd24 commit 0e51936
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packagecontrol.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,11 @@ def on_execute(self, item, action):
if action is not None and action.name() == "visit_homepage":
package = self._get_package(item.data_bag())
if package.homepage:
kpu.shell_execute(package.homepage)
self.dbg(urllib.parse.urlparse(package.homepage).scheme)
if urllib.parse.urlparse(package.homepage).scheme in ("http", "https"):
kpu.shell_execute(package.homepage)
else:
self.warn("Package homepage is not a web link: ", package.homepage)
else:
self.warn("Package homepage not set")
return
Expand Down

0 comments on commit 0e51936

Please sign in to comment.