Browse Source

Grab favicon from site's URL, not the feed's

• Changed Feed to where the favicon is gotten when parsing so the
feed’s site URL is used instead of the feed’s for favicons. Some feeds
don’t have the same domain.
• Fixed a bug in Database.
microsub
Dustin Wilson 7 years ago
parent
commit
25aeaf4801
  1. 2
      lib/Database.php
  2. 7
      lib/Feed.php

2
lib/Database.php

@ -499,7 +499,7 @@ class Database {
try {
$feed = new Feed($f['url'], $f['lastmodified'], $f['etag'], $f['username'], $f['password']);
} catch (Feed\Exception $e) {
$this->db->prepare('UPDATE arsse_feeds SET err_count = err_count + 1, err_msg = "" WHERE id is ?', 'str', 'int')->run(
$this->db->prepare('UPDATE arsse_feeds SET err_count = err_count + 1, err_msg = ? WHERE id is ?', 'str', 'int')->run(
$e->getMessage(),
$f['id']
);

7
lib/Feed.php

@ -21,8 +21,6 @@ class Feed {
$this->reader = new Reader($config);
$this->resource = $this->reader->download($url, $lastModified, $etag, $username, $password);
// Grab the favicon for the feed; returns an empty string if it cannot find one.
$this->favicon = (new Favicon)->find($url);
} catch (PicoFeedException $e) {
throw new Feed\Exception($url, $e);
}
@ -36,6 +34,11 @@ class Feed {
$this->resource->getEncoding()
);
$feed = $this->parser->execute();
// Grab the favicon for the feed; returns an empty string if it cannot find one.
// Some feeds might use a different domain (eg: feedburner), so the site url is
// used instead of the feed's url.
$this->favicon = (new Favicon)->find($siteUrl);
} catch (PicoFeedException $e) {
throw new Feed\Exception($url, $e);
}

Loading…
Cancel
Save