Skip to content
Snippets Groups Projects
Commit 14b35e5a authored by Damien McKenna's avatar Damien McKenna Committed by Damien McKenna
Browse files

Issue #3367232 by DamienMcKenna: A better location for the absolute URL logic.

parent 47c68e27
No related branches found
No related tags found
No related merge requests found
......@@ -7,6 +7,7 @@ Advanced Views RSS Feed 8.x-2.x-dev, 2022-xx-xx
#3366701 by DamienMcKenna: Fix tests in D10.0.
#3366793 by DamienMcKenna: Fix channel pubDate value on Drupal 10.1.
#3367232 by DamienMcKenna: media:thumbnail URL should be absolute.
#3367232 by DamienMcKenna: A better location for the absolute URL logic.
Advanced Views RSS Feed 8.x-2.0, 2023-06-14
......
......@@ -138,11 +138,6 @@ function views_rss_media_preprocess_item_thumbnail(&$variables) {
$element['attributes']['width'] = $matches[2];
$element['attributes']['height'] = $matches[3];
// Convert the URL to an absolute path.
if (strpos($element['attributes']['url'], '/') === 0) {
$element['attributes']['url'] = $GLOBALS['base_url'] . $element['attributes']['url'];
}
// @todo Work out a better location for this.
// @code
// $element['attributes']['title'] = $matches[4];
......@@ -156,6 +151,11 @@ function views_rss_media_preprocess_item_thumbnail(&$variables) {
$element['attributes']['url'] = $item['rendered']['#markup'];
}
// Convert the URL to an absolute path.
if (strpos($element['attributes']['url'], '/') === 0) {
$element['attributes']['url'] = $GLOBALS['base_url'] . $element['attributes']['url'];
}
$variables['elements'][] = $element;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment