diff --git a/plugins/Sf.py b/plugins/Sf.py index 817fe2e52..8d56a1fbd 100644 --- a/plugins/Sf.py +++ b/plugins/Sf.py @@ -243,7 +243,7 @@ class Sf(callbacks.PrivmsgCommandAndRegexp): _sfTitle = re.compile(r'Detail:(\d+) - ([^<]+)', re.I) _linkType = re.compile(r'(\w+ \w+|\w+): Tracker Detailed View', re.I) def sfSnarfer(self, irc, msg, match): - r"https?://(?:www\.)?sourceforge\.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+" if not self.snarfer: return url = match.group(0) diff --git a/test/test_Sf.py b/test/test_Sf.py index 22bb04259..aa7ae4c51 100644 --- a/test/test_Sf.py +++ b/test/test_Sf.py @@ -73,6 +73,9 @@ class SfTest(PluginTestCase, PluginDocumentation): # test that it works with www and without index.php self.assertNotError('http://www.sourceforge.net/tracker/?'\ 'func=detail&aid=540223&group_id=235&atid=300235') + # test that it works with sf.net + self.assertNotError('http://sf.net/tracker/?'\ + 'func=detail&aid=540223&group_id=235&atid=300235') def testHttpsSnarfer(self): s = r';.*Status.*: \w+;' @@ -86,6 +89,7 @@ class SfTest(PluginTestCase, PluginDocumentation): 'func=detail&aid=561547&group_id=235&atid=200235', s) self.assertRegexp('http://sourceforge.net/tracker/index.php?'\ 'func=detail&aid=400942&group_id=235&atid=390395', s) + # test that it works without index.php self.assertNotError('https://sourceforge.net/tracker/?'\ 'func=detail&aid=540223&group_id=235&atid=300235') @@ -95,6 +99,9 @@ class SfTest(PluginTestCase, PluginDocumentation): # test that it works with www and without index.php self.assertNotError('https://www.sourceforge.net/tracker/index.php?'\ 'func=detail&aid=540223&group_id=235&atid=300235') + # test that it works with www and without index.php + self.assertNotError('https://sf.net/tracker/index.php?'\ + 'func=detail&aid=540223&group_id=235&atid=300235') def testDisablesfsnarfer(self): self.assertRegexp('http://sourceforge.net/tracker/index.php?'\