The snarfer wasn't quite fixed. Should be fixed for good this time. Also added

a test to make sure that a bad url isn't snarfed.
This commit is contained in:
James Vega 2003-10-22 15:58:07 +00:00
parent d55f5c489f
commit 89e5a4aa0e
2 changed files with 3 additions and 1 deletions

View File

@ -246,7 +246,7 @@ class Sourceforge(callbacks.PrivmsgCommandAndRegexp):
_sfTitle = re.compile(r'Detail:(\d+) - ([^<]+)</title>', re.I)
_linkType = re.compile(r'(\w+ \w+|\w+): Tracker Detailed View', re.I)
def sfSnarfer(self, irc, msg, match):
r"https?://(?:www\.)?(?:sourceforge|sf)\.net/tracker/(?:index\.php)?\?(?:&?func=detail|&?aid=\d+|&?group_id=\d+|&?atid=\d+)+"
r"https?://(?:www\.)?(?:sourceforge|sf)\.net/tracker/(?:index\.php)?\?(?:&?func=detail|&?aid=\d+|&?group_id=\d+|&?atid=\d+){4}"
if not self.snarfer:
return
url = match.group(0)

View File

@ -79,6 +79,8 @@ class SourceforgeTest(PluginTestCase, PluginDocumentation):
# test that it works
self.assertNotError('https://sourceforge.net/tracker/?'
'func=detail&atid=105470&aid=827260&group_id=5470')
self.assertNoResponse('https://sourceforge.net/tracker/?'\
'group_id=58965&atid=489447')
def testDisablesfsnarfer(self):
self.assertRegexp('http://sourceforge.net/tracker/index.php?'\