summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2012-07-05 00:49:00 +0200
committerFlorent Le Coz <louiz@louiz.org>2012-07-05 00:50:47 +0200
commitd47c31a58748d6cfc52c893eaf39d5412cba1f84 (patch)
treec7017b92a9011a4b5fcf75541ac079f43d1c4d86 /plugins
parent73b8addafe654077b80b33e8f200c33ec671d2ee (diff)
downloadpoezio-d47c31a58748d6cfc52c893eaf39d5412cba1f84.tar.gz
poezio-d47c31a58748d6cfc52c893eaf39d5412cba1f84.tar.bz2
poezio-d47c31a58748d6cfc52c893eaf39d5412cba1f84.tar.xz
poezio-d47c31a58748d6cfc52c893eaf39d5412cba1f84.zip
Properly quote the %(body)s and %(from)s used in the simple_notify plugin.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/simple_notify.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/plugins/simple_notify.py b/plugins/simple_notify.py
index bc31c961..c2cbb198 100644
--- a/plugins/simple_notify.py
+++ b/plugins/simple_notify.py
@@ -1,6 +1,7 @@
from plugin import BasePlugin
from xhtml import clean_text, get_body_from_message_stanza
from timed_events import DelayedEvent
+import pipes
class Plugin(BasePlugin):
def init(self):
@@ -28,9 +29,10 @@ class Plugin(BasePlugin):
if not command:
self.core.information('No notification command was provided in the configuration file', 'Warning')
return
- self.core.exec_command(command % {'body':body, 'from':fro})
+ self.core.exec_command(command % {'body':pipes.quote(body), 'from':pipes.quote(fro)})
after_command = self.config.get('after_command', '').strip()
if not after_command:
return
- delayed_event = DelayedEvent(self.config.get('delay', 1), self.core.exec_command, after_command % {'body':body, 'from':fro})
+ delayed_event = DelayedEvent(self.config.get('delay', 1), self.core.exec_command, after_command % {'body':pipes.quote(body), 'from':pipes.quote(fro)})
self.core.add_timed_event(delayed_event)
+4