From a536c1dc4f4c28da96a64a6c91e6ed5061e3c077 Mon Sep 17 00:00:00 2001 From: Florent Le Coz Date: Mon, 22 Oct 2012 17:14:21 +0200 Subject: Make the Executor class reliable. Plugins do not need to escape the command arguments or remove the line breaks and care about how the will get parsed anymore, they just need to pass a list of args. Do not spawn an additional shell, for more clarity, simplicity and possibly security. --- plugins/link.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'plugins/link.py') diff --git a/plugins/link.py b/plugins/link.py index 8d757be6..427d718a 100644 --- a/plugins/link.py +++ b/plugins/link.py @@ -7,7 +7,6 @@ from plugin import BasePlugin from xhtml import clean_text import common import tabs -import pipes url_pattern = re.compile(r'\b(http[s]?://(?:\S+))\b', re.I|re.U) @@ -42,8 +41,7 @@ class Plugin(BasePlugin): nb = 1 link = self.find_link(nb) if link: - link = pipes.quote(link) - self.core.exec_command("%s %s" % (self.config.get('browser', 'firefox'), link)) + self.core.exec_command([self.config.get('browser', 'firefox'), link]) else: self.core.information('No URL found.', 'Warning') -- cgit v1.2.3