1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-26 01:11:28 +00:00

hide uninteresting errors in several DOMDocument->loadHTML() invocations

This commit is contained in:
Andrew Dolgov
2020-10-01 13:20:07 +03:00
parent 24cdacd59e
commit 38a7a1da88
5 changed files with 8 additions and 8 deletions

View File

@@ -1341,9 +1341,9 @@ class RSSUtils {
static function cache_media($html, $site_url) {
$cache = new DiskCache("images");
if ($cache->isWritable()) {
if ($html && $cache->isWritable()) {
$doc = new DOMDocument();
if ($doc->loadHTML($html)) {
if (@$doc->loadHTML($html)) {
$xpath = new DOMXPath($doc);
$entries = $xpath->query('(//img[@src]|//source[@src|@srcset]|//video[@poster|@src])');
@@ -1829,7 +1829,7 @@ class RSSUtils {
if ($html = @UrlHelper::fetch($url)) {
$doc = new DOMDocument();
if ($doc->loadHTML($html)) {
if (@$doc->loadHTML($html)) {
$xpath = new DOMXPath($doc);
$base = $xpath->query('/html/head/base[@href]');