From 1e638e7fd03101f922c99c881f8edea6d3f4578a Mon Sep 17 00:00:00 2001 From: sebsel Date: Thu, 15 Nov 2018 23:32:32 +0100 Subject: [PATCH] fix a case where the removed h-card is the first item MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The previous check removed a h-card, but this one still takes the first of the original array. Which means, in the case of `h-card+h-entry`, the h-card get’s removed, but then the if triggers and the `h-card` is selected. --- lib/XRay/Formats/Mf2.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/XRay/Formats/Mf2.php b/lib/XRay/Formats/Mf2.php index 4e6a10f..1740736 100644 --- a/lib/XRay/Formats/Mf2.php +++ b/lib/XRay/Formats/Mf2.php @@ -42,7 +42,7 @@ class Mf2 extends Format { // If there is only one item left on the page, it's a permalink, and just use that if(count($items) == 1) { - $item = $mf2['items'][0]; + $item = $items[0]; if(in_array('h-entry', $item['type']) || in_array('h-cite', $item['type'])) { #Parse::debug("mf2:0: Recognized $url as an h-entry it is the only item on the page"); return self::parseAsHEntry($mf2, $item, $http, $url);