From 8b4a38cef75d73c7826ea38e7d08d09e96279564 Mon Sep 17 00:00:00 2001 From: Aaron Parecki Date: Thu, 30 Aug 2018 13:12:41 -0700 Subject: [PATCH] catch error with rel-urls --- lib/XRay/Formats/HTML.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/XRay/Formats/HTML.php b/lib/XRay/Formats/HTML.php index 37c2b06..3f83893 100644 --- a/lib/XRay/Formats/HTML.php +++ b/lib/XRay/Formats/HTML.php @@ -102,12 +102,14 @@ class HTML extends Format { foreach($mf2['rel-urls'] as $relurl => $reltype) { - if(in_array('alternate', $reltype['rels']) && $reltype['type'] == 'application/mf2+json') { - $alternates['mf2'][] = $relurl; - } + if(isset($reltype['type'])) { + if(in_array('alternate', $reltype['rels']) && $reltype['type'] == 'application/mf2+json') { + $alternates['mf2'][] = $relurl; + } - if(in_array('alternate', $reltype['rels']) && $reltype['type'] == 'application/activity+json') { - $alternates['as2'][] = $relurl; + if(in_array('alternate', $reltype['rels']) && $reltype['type'] == 'application/activity+json') { + $alternates['as2'][] = $relurl; + } } }