From c2c58d5fa2c5048661368d68637f79c6df5e650a Mon Sep 17 00:00:00 2001 From: Peter Ajamian Date: Wed, 9 Sep 2020 17:21:38 +1200 Subject: [PATCH] Check to see if matched domain exists in dictionary. Check to see if matched domain exists in dictionary before attempting to access it. --- __init__.py | 2 +- plugin.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/__init__.py b/__init__.py index dbef5aa..8689cbc 100644 --- a/__init__.py +++ b/__init__.py @@ -38,7 +38,7 @@ from supybot import world # Use this for the version of this plugin. You may wish to put a CVS keyword # in here if you're keeping the plugin in CVS or some similar system. -__version__ = "0.3" +__version__ = "0.4" # XXX Replace this with an appropriate author or supybot.Author instance. __author__ = supybot.Author('Peter Ajamian', 'pj', 'peter@pajamian.dhs.org') diff --git a/plugin.py b/plugin.py index 644b1e0..71f7afe 100644 --- a/plugin.py +++ b/plugin.py @@ -78,6 +78,8 @@ class Pastebin2cpaste(callbacks.Plugin): else: text = msg.args[1] for url in utils.web.httpUrlRe.findall(text): + if ! utils.web.getDomain(url).lower() in self.pastebins: + continue pastebin = self.pastebins[utils.web.getDomain(url).lower()] if pastebin: pbCode = pastebin['regex'].search(url).group(1)