From 23cd446e0b3f3fa0ad38bc72e841ff87809992ac Mon Sep 17 00:00:00 2001 From: Akamaru Date: Wed, 17 Jun 2015 20:30:14 +0200 Subject: [PATCH] fixed a critical bug in cowsay and youtube_dl --- plugins/cowsay.lua | 4 ++++ plugins/youtube_dl.lua | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/plugins/cowsay.lua b/plugins/cowsay.lua index 904efca..735947a 100644 --- a/plugins/cowsay.lua +++ b/plugins/cowsay.lua @@ -1,8 +1,12 @@ function run(msg, matches) cow = matches[1] local receiver = get_receiver(msg) + if string.match(msg.text, '"') then + return 'Vergiss es' + else local text = run_bash('cowsay "' .. cow .. '"') send_msg(receiver, text, ok_cb, false) + end end return { diff --git a/plugins/youtube_dl.lua b/plugins/youtube_dl.lua index 7d79584..64cd3e7 100644 --- a/plugins/youtube_dl.lua +++ b/plugins/youtube_dl.lua @@ -1,9 +1,14 @@ +-- Requires: (sudo) apt-get install youtube-dl function run(msg, matches) URL = matches[1] local receiver = get_receiver(msg) + if string.match(msg.text, '"') then + return 'Vergiss es' + else text = run_bash("rm tmp/video.mp4 && youtube-dl -o tmp/video.mp4 " .. URL) send_video(get_receiver(msg), "tmp/video.mp4", ok_cb, false) return URL .. ' wurde gedownloadet und wird jetzt gesendet! \nDas kann je nach Video sehr lang dauern! \nAlso habt Gedult!' + end end return {