rssutils: rewrite several invocations of (deprecated) rewrite_relative_url() to UrlHelper::rewrite_relative()

This commit is contained in:
Andrew Dolgov 2021-12-20 08:03:30 +03:00
parent 40b2356be2
commit 7aeaa1b039
1 changed files with 7 additions and 7 deletions

View File

@ -557,7 +557,7 @@ class RSSUtils {
Debug::log("language: $feed_language", Debug::LOG_VERBOSE); Debug::log("language: $feed_language", Debug::LOG_VERBOSE);
Debug::log("processing feed data...", Debug::LOG_VERBOSE); Debug::log("processing feed data...", Debug::LOG_VERBOSE);
$site_url = mb_substr(rewrite_relative_url($feed_obj->feed_url, clean($rss->get_link())), 0, 245); $site_url = mb_substr(UrlHelper::rewrite_relative($feed_obj->feed_url, clean($rss->get_link())), 0, 245);
Debug::log("site_url: $site_url", Debug::LOG_VERBOSE); Debug::log("site_url: $site_url", Debug::LOG_VERBOSE);
Debug::log("feed_title: {$rss->get_title()}", Debug::LOG_VERBOSE); Debug::log("feed_title: {$rss->get_title()}", Debug::LOG_VERBOSE);
@ -736,7 +736,7 @@ class RSSUtils {
// TODO: Just use FeedEnclosure (and modify it to cover whatever justified this)? // TODO: Just use FeedEnclosure (and modify it to cover whatever justified this)?
$e_item = array( $e_item = array(
rewrite_relative_url($site_url, $e->link), UrlHelper::rewrite_relative($site_url, $e->link),
$e->type, $e->length, $e->title, $e->width, $e->height); $e->type, $e->length, $e->title, $e->width, $e->height);
// Yet another episode of "mysql utf8_general_ci is gimped" // Yet another episode of "mysql utf8_general_ci is gimped"
@ -1284,7 +1284,7 @@ class RSSUtils {
foreach ($enclosures as $enc) { foreach ($enclosures as $enc) {
if (preg_match("/(image|audio|video)/", $enc[1])) { if (preg_match("/(image|audio|video)/", $enc[1])) {
$src = rewrite_relative_url($site_url, $enc[0]); $src = UrlHelper::rewrite_relative($site_url, $enc[0]);
$local_filename = sha1($src); $local_filename = sha1($src);
@ -1310,7 +1310,7 @@ class RSSUtils {
/* TODO: move to DiskCache? */ /* TODO: move to DiskCache? */
static function cache_media_url(DiskCache $cache, string $url, string $site_url): void { static function cache_media_url(DiskCache $cache, string $url, string $site_url): void {
$url = rewrite_relative_url($site_url, $url); $url = UrlHelper::rewrite_relative($site_url, $url);
$local_filename = sha1($url); $local_filename = sha1($url);
Debug::log("cache_media: checking $url", Debug::LOG_VERBOSE); Debug::log("cache_media: checking $url", Debug::LOG_VERBOSE);
@ -1872,14 +1872,14 @@ class RSSUtils {
$base = $xpath->query('/html/head/base[@href]'); $base = $xpath->query('/html/head/base[@href]');
foreach ($base as $b) { foreach ($base as $b) {
$url = rewrite_relative_url($url, $b->getAttribute("href")); $url = UrlHelper::rewrite_relative($url, $b->getAttribute("href"));
break; break;
} }
$entries = $xpath->query('/html/head/link[@rel="shortcut icon" or @rel="icon"]'); $entries = $xpath->query('/html/head/link[@rel="shortcut icon" or @rel="icon"]');
if (count($entries) > 0) { if (count($entries) > 0) {
foreach ($entries as $entry) { foreach ($entries as $entry) {
$favicon_url = rewrite_relative_url($url, $entry->getAttribute("href")); $favicon_url = UrlHelper::rewrite_relative($url, $entry->getAttribute("href"));
break; break;
} }
} }
@ -1887,7 +1887,7 @@ class RSSUtils {
} }
if (!$favicon_url) if (!$favicon_url)
$favicon_url = rewrite_relative_url($url, "/favicon.ico"); $favicon_url = UrlHelper::rewrite_relative($url, "/favicon.ico");
return $favicon_url; return $favicon_url;
} }