From e1600cc5bcb9e6f2a01176d69ad71bf3a12d4fe6 Mon Sep 17 00:00:00 2001 From: Aaron Parecki Date: Sat, 14 Jul 2018 11:00:13 -0700 Subject: [PATCH] real fix for quotation-of --- lib/XRay/Formats/Mf2.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/XRay/Formats/Mf2.php b/lib/XRay/Formats/Mf2.php index 7848f43..92c37d4 100644 --- a/lib/XRay/Formats/Mf2.php +++ b/lib/XRay/Formats/Mf2.php @@ -414,7 +414,7 @@ class Mf2 extends Format { $refs = []; // Single plaintext and URL values - self::collectSingleValues(['published','summary','rsvp','swarm-coins'], ['url','featured','quotation-of'], $item, $url, $data); + self::collectSingleValues(['published','summary','rsvp','swarm-coins'], ['url','featured'], $item, $url, $data); if(isset($data['rsvp'])) $data['rsvp'] = strtolower($data['rsvp']); @@ -431,7 +431,11 @@ class Mf2 extends Format { // These properties are always returned as arrays and always URLs // If the value is an h-* object with a URL, the URL is used and a "ref" is added as well - self::collectArrayURLValues(['photo','video','audio','syndication','in-reply-to','like-of','repost-of','bookmark-of'], $item, $data, $refs, $http); + self::collectArrayURLValues(['photo','video','audio','syndication','in-reply-to','like-of','repost-of','bookmark-of','quotation-of'], $item, $data, $refs, $http); + + // Hack to make quotation-of a single value + if(isset($data['quotation-of'])) + $data['quotation-of'] = $data['quotation-of'][0]; self::determineNameAndContent($item, $data);