Skip to content

Commit

Permalink
Ensure image regex looks only in img tags
Browse files Browse the repository at this point in the history
  • Loading branch information
weierophinney committed Nov 19, 2015
1 parent 4227393 commit 69de48b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ComicSource/AbstractRssSource.php
Expand Up @@ -117,7 +117,7 @@ protected function getDataFromFeed(SimpleXMLElement $feed)
protected function getImageFromContent($content)
{
// image is in content -- /src="([^"]+)"
if (preg_match('/src="(?P<src>[^"]+)"/', $content, $matches)) {
if (preg_match('/\<img [^>]*src="(?P<src>[^"]+)"/', $content, $matches)) {
return $matches['src'];
}
return false;
Expand Down

0 comments on commit 69de48b

Please sign in to comment.