diff --git a/plugins/Http.py b/plugins/Http.py index 151c4ab3d..6a54e8e00 100644 --- a/plugins/Http.py +++ b/plugins/Http.py @@ -79,7 +79,7 @@ class FreshmeatException(Exception): class Http(callbacks.Privmsg): threaded = True - _titleRe = re.compile(r'(.*)', re.I | re.S) + _titleRe = re.compile(r'(.*?)', re.I | re.S) def title(self, irc, msg, args): """ diff --git a/test/test_Http.py b/test/test_Http.py index 2b5b84126..6b4571629 100644 --- a/test/test_Http.py +++ b/test/test_Http.py @@ -49,6 +49,11 @@ class HttpTest(PluginTestCase, PluginDocumentation): '1884822312/qid=1063140754/sr=8-1/ref=sr_8_1/' '002-9802970-2308826?v=glance&s=books&n=507846', 'no HTML title') + # Checks the non-greediness of the regexp + self.assertResponse('title ' + 'http://www.space.com/scienceastronomy/' + 'jupiter_dark_spot_031023.html', + 'Mystery Spot on Jupiter Baffles Astronomers') def testGeekquote(self): self.assertNotError('geekquote')