From b21fe199ed19fcc08fe3ece2d9ab553dcc0e73c9 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Wed, 1 Dec 2021 23:24:18 +0100 Subject: Manual update SimplePie (#4011) * https://github.com/simplepie/simplepie/commit/417a1661b2610448bd8e1835d6d4160a0aff9a97 * https://github.com/simplepie/simplepie/commit/ebdd0643ee927edfcaf40bfd27ab23ce9c975120 * https://github.com/simplepie/simplepie/commit/941412027a46979b4f1d29e53edf91829788d781 * https://github.com/simplepie/simplepie/commit/f58a23730f01f26bbcfe02ff9266e337c241be88 --- lib/SimplePie/SimplePie.php | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'lib/SimplePie/SimplePie.php') diff --git a/lib/SimplePie/SimplePie.php b/lib/SimplePie/SimplePie.php index 15b4dfea4..fbb0041f6 100644 --- a/lib/SimplePie/SimplePie.php +++ b/lib/SimplePie/SimplePie.php @@ -2707,13 +2707,19 @@ class SimplePie } } - if (isset($this->data['headers']['link']) && - preg_match('/<([^>]+)>; rel='.preg_quote($rel).'/', - $this->data['headers']['link'], $match)) + if (isset($this->data['headers']['link'])) { - return array($match[1]); + $link_headers = $this->data['headers']['link']; + if (is_string($link_headers)) { + $link_headers = array($link_headers); + } + $matches = preg_filter('/<([^>]+)>; rel='.preg_quote($rel).'/', '$1', $link_headers); + if (!empty($matches)) { + return $matches; + } } - else if (isset($this->data['links'][$rel])) + + if (isset($this->data['links'][$rel])) { return $this->data['links'][$rel]; } -- cgit v1.2.3