Skip to content

Commit

Permalink
Merge pull request #283 from Roromis/master
Browse files Browse the repository at this point in the history
Fix : Some icons weren't fetched
  • Loading branch information
SSilence committed Apr 21, 2013
2 parents 436fb5b + 648fac0 commit 9133232
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion helpers/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function fetchFavicon($url, $isHtmlUrl=false, $width=false, $height=false
elseif (substr($shortcutIcon, 0, 1)=='/')
$shortcutIcon = $urlElements['scheme'] . '://' . $urlElements['host'] . $shortcutIcon;
else
$shortcutIcon = $url . $shortcutIcon;
$shortcutIcon = $url . '/' . $shortcutIcon;
}

$faviconAsPng = $this->loadImage($shortcutIcon, $width, $height);
Expand Down Expand Up @@ -159,6 +159,8 @@ private function parseShortcutIcon($html) {
$result = preg_match('/<link .*rel=("|\')apple-touch-icon\1.*>/Ui', $html, $match1);
if($result==0)
$result = preg_match('/<link [^>]*rel=("|\')shortcut icon\1.*>/Ui', $html, $match1);
if($result==0)
$result = preg_match('/<link [^>]*rel=("|\')icon\1.*>/Ui', $html, $match1);
if($result>0) {
preg_match('/href=("|\')(.*)\1/Ui', $match1[0], $match2);
return $match2[2];
Expand Down

0 comments on commit 9133232

Please sign in to comment.