aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/favicons.php4
-rw-r--r--lib/lib_rss.php1
2 files changed, 5 insertions, 0 deletions
diff --git a/lib/favicons.php b/lib/favicons.php
index 3072874d7..786f832fc 100644
--- a/lib/favicons.php
+++ b/lib/favicons.php
@@ -26,6 +26,10 @@ function faviconCachePath(string $url): string {
}
function searchFavicon(string $url): string {
+ $url = trim($url);
+ if ($url === '') {
+ return '';
+ }
$dom = new DOMDocument();
['body' => $html, 'effective_url' => $effective_url, 'fail' => $fail] = httpGet($url, cachePath: CACHE_PATH . '/' . sha1($url) . '.html', type: 'html');
if ($fail || $html === '' || !@$dom->loadHTML($html, LIBXML_NONET | LIBXML_NOERROR | LIBXML_NOWARNING)) {
diff --git a/lib/lib_rss.php b/lib/lib_rss.php
index 266e95b65..01c8a0088 100644
--- a/lib/lib_rss.php
+++ b/lib/lib_rss.php
@@ -570,6 +570,7 @@ function enforceHtmlBase(string $html, string $href): string {
}
/**
+ * @param non-empty-string $url
* @param string $type {html,ico,json,opml,xml}
* @param array<string,mixed> $attributes
* @param array<int,mixed> $curl_options