aboutsummaryrefslogtreecommitdiff
path: root/lib/favicons.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2025-11-11 08:17:12 +0100
committerGravatar GitHub <noreply@github.com> 2025-11-11 08:17:12 +0100
commita18c35046daee15e7ac5f85db290d54541a03e3c (patch)
treeec638cf7c93537a4f81b27216097d8509252eb81 /lib/favicons.php
parent5e622c60fa5c40793138807280319f7e84d00cc6 (diff)
Housekeeping lib_rss.php (#8193)
* Housekeeping lib_rss.php `lib_rss.php` had become much too large, especially after https://github.com/FreshRSS/FreshRSS/pull/7924 Moved most functions to other places. Mostly no change of code otherwise (see comments). * Extension: composer run-script phpstan-third-party
Diffstat (limited to 'lib/favicons.php')
-rw-r--r--lib/favicons.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/favicons.php b/lib/favicons.php
index 786f832fc..7c12a842e 100644
--- a/lib/favicons.php
+++ b/lib/favicons.php
@@ -31,7 +31,8 @@ function searchFavicon(string $url): string {
return '';
}
$dom = new DOMDocument();
- ['body' => $html, 'effective_url' => $effective_url, 'fail' => $fail] = httpGet($url, cachePath: CACHE_PATH . '/' . sha1($url) . '.html', type: 'html');
+ ['body' => $html, 'effective_url' => $effective_url, 'fail' => $fail] =
+ FreshRSS_http_Util::httpGet($url, cachePath: CACHE_PATH . '/' . sha1($url) . '.html', type: 'html');
if ($fail || $html === '' || !@$dom->loadHTML($html, LIBXML_NONET | LIBXML_NOERROR | LIBXML_NOWARNING)) {
return '';
}
@@ -69,7 +70,7 @@ function searchFavicon(string $url): string {
if ($iri == false) {
return '';
}
- $favicon = httpGet($iri, faviconCachePath($iri), 'ico', curl_options: [
+ $favicon = FreshRSS_http_Util::httpGet($iri, faviconCachePath($iri), 'ico', curl_options: [
CURLOPT_REFERER => $effective_url,
])['body'];
if (isImgMime($favicon)) {
@@ -90,7 +91,7 @@ function download_favicon(string $url, string $dest): bool {
}
if ($favicon == '') {
$link = $rootUrl . 'favicon.ico';
- $favicon = httpGet($link, faviconCachePath($link), 'ico', curl_options: [
+ $favicon = FreshRSS_http_Util::httpGet($link, faviconCachePath($link), 'ico', curl_options: [
CURLOPT_REFERER => $url,
])['body'];
if (!isImgMime($favicon)) {