af_redditimgur: better handling of image urls with multiple-character numeric suffixes

This commit is contained in:
Andrew Dolgov 2015-07-05 17:47:53 +03:00
parent 611e5ba37d
commit 5f58daa2fb
1 changed files with 2 additions and 3 deletions

View File

@ -84,9 +84,8 @@ class Af_RedditImgur extends Plugin {
$found = true; $found = true;
} }
if (preg_match("/\.(jpg|jpeg|gif|png)(\?[0-9])?$/i", $entry->getAttribute("href"))) { if (preg_match("/\.(jpg|jpeg|gif|png)(\?[0-9][0-9]*)?$/i", $entry->getAttribute("href"))) {
$img = $doc->createElement('img');
$img = $doc->createElement('img');
$img->setAttribute("src", $entry->getAttribute("href")); $img->setAttribute("src", $entry->getAttribute("href"));
$br = $doc->createElement('br'); $br = $doc->createElement('br');