Skip to content

Commit

Permalink
Merge branch 'hotfix/dorktower'
Browse files Browse the repository at this point in the history
  • Loading branch information
weierophinney committed Jul 25, 2015
2 parents e0cf760 + ace8f9a commit 57a9302
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/ComicSource/DorkTower.php
Expand Up @@ -13,4 +13,22 @@ class DorkTower extends AbstractRssSource
protected $feedUrl = 'http://www.dorktower.com/feed/';
protected $tagNamespace = 'http://purl.org/rss/1.0/modules/content/';
protected $tagWithImage = 'encoded';

/**
* Override image capturing from content.
*
* Images have a specific format in the feed; if they do not match that
* format, do not use them.
*
* @param string $content Feed item content
* @return false|string
*/
protected function getImageFromContent($content)
{
$image = parent::getImageFromContent($content);
if (! preg_match('#/\d{4}/\d{2}/DorkTower\d+\.(?:jpg|jpeg|png|gif)$#', $image)) {
return false;
}
return $image;
}
}

0 comments on commit 57a9302

Please sign in to comment.