Browse Source

fix a case where the removed h-card is the first item

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.
pull/83/head
sebsel 5 years ago
parent
commit
1e638e7fd0
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      lib/XRay/Formats/Mf2.php

+ 1
- 1
lib/XRay/Formats/Mf2.php View File

@ -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);

Loading…
Cancel
Save