diff --git a/lib/Database.php b/lib/Database.php index ac319cd1..e2ada448 100644 --- a/lib/Database.php +++ b/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'] ); diff --git a/lib/Feed.php b/lib/Feed.php index 1c606b17..b6f43645 100644 --- a/lib/Feed.php +++ b/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); }