mirror of
https://github.com/pajamian/Pastebin2cpaste.git
synced 2025-04-25 12:31:07 -05:00
Check to see if matched domain exists in dictionary.
Check to see if matched domain exists in dictionary before attempting to access it.
This commit is contained in:
parent
df22176150
commit
c2c58d5fa2
@ -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')
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user