From 69de48b5efea11f9f5f9bb6f67a4b31eaf22f200 Mon Sep 17 00:00:00 2001 From: Matthew Weier O'Phinney Date: Thu, 19 Nov 2015 09:04:53 -0600 Subject: [PATCH] Ensure image regex looks only in img tags --- src/ComicSource/AbstractRssSource.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ComicSource/AbstractRssSource.php b/src/ComicSource/AbstractRssSource.php index f6c0842..c4a4528 100644 --- a/src/ComicSource/AbstractRssSource.php +++ b/src/ComicSource/AbstractRssSource.php @@ -117,7 +117,7 @@ protected function getDataFromFeed(SimpleXMLElement $feed) protected function getImageFromContent($content) { // image is in content -- /src="([^"]+)" - if (preg_match('/src="(?P[^"]+)"/', $content, $matches)) { + if (preg_match('/\]*src="(?P[^"]+)"/', $content, $matches)) { return $matches['src']; } return false;