From 442019a0548d3f1d888419930d38f1986e5cd773 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Mon, 5 Sep 2022 09:15:20 +0200 Subject: SimplePie fix base (#4565) * SimplePie fix base #fix https://github.com/FreshRSS/FreshRSS/issues/4562 See `` example in https://datatracker.ietf.org/doc/html/rfc4287#section-1.1 First uses item `` if it exists, or the item own link, or the feed's base URL rules (feed URL, or Web site URL) * Minor formatting --- lib/SimplePie/SimplePie/Item.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/SimplePie/SimplePie/Item.php b/lib/SimplePie/SimplePie/Item.php index 3ac4fa882..2fb1d3284 100644 --- a/lib/SimplePie/SimplePie/Item.php +++ b/lib/SimplePie/SimplePie/Item.php @@ -152,15 +152,21 @@ class SimplePie_Item } /** - * Get the base URL value from the parent feed - * - * Uses `` + * Get the base URL value. + * Uses ``, or item link, or feed base URL. * * @param array $element * @return string */ public function get_base($element = array()) { + if (!empty($element['xml_base_explicit']) && isset($element['xml_base'])) { + return $element['xml_base']; + } + $link = $this->get_permalink(); + if ($link != null) { + return $link; + } return $this->feed->get_base($element); } -- cgit v1.2.3