update example reddit filter

This commit is contained in:
Andrew Dolgov 2012-11-26 14:38:33 +04:00
parent cc85704f3c
commit dd8c289b8f
1 changed files with 1 additions and 1 deletions

View File

@ -15,7 +15,7 @@ class Filter_RedditImgur {
foreach ($entries as $entry) { foreach ($entries as $entry) {
if ($entry->hasAttribute("href")) { if ($entry->hasAttribute("href")) {
if (preg_match("/i.imgur.com\/.*?.jpg/", $entry->getAttribute("href"))) { if (preg_match("/\.(jpg|jpeg|gif|png)$/i", $entry->getAttribute("href"))) {
$img = $doc->createElement('img'); $img = $doc->createElement('img');
$img->setAttribute("src", $entry->getAttribute("href")); $img->setAttribute("src", $entry->getAttribute("href"));