From 18b17cbc839026ecb99c2b044e401c2032626df7 Mon Sep 17 00:00:00 2001 From: wn_ Date: Sun, 15 Dec 2024 13:39:54 +0000 Subject: Revert some stuff based upon feedback --- classes/FeedItem_Common.php | 53 ++++++++++++++++++++++++--------------------- 1 file changed, 28 insertions(+), 25 deletions(-) (limited to 'classes/FeedItem_Common.php') diff --git a/classes/FeedItem_Common.php b/classes/FeedItem_Common.php index 5b30ab20c..5ec958699 100644 --- a/classes/FeedItem_Common.php +++ b/classes/FeedItem_Common.php @@ -1,10 +1,14 @@ elem = $elem; + $this->doc = $doc; + $this->xpath = $xpath; + try { $source = $elem->getElementsByTagName("source")->item(0); @@ -88,13 +92,12 @@ abstract class FeedItem_Common extends FeedItem { $enclosures = $this->xpath->query("media:content", $this->elem); foreach ($enclosures as $enclosure) { - $enc = new FeedEnclosure( - type: clean($enclosure->getAttribute('type')), - link: clean($enclosure->getAttribute('url')), - length: clean($enclosure->getAttribute('length')), - height: clean($enclosure->getAttribute('height')), - width: clean($enclosure->getAttribute('width')), - ); + $enc = new FeedEnclosure(); + $enc->type = clean($enclosure->getAttribute('type')); + $enc->link = clean($enclosure->getAttribute('url')); + $enc->length = clean($enclosure->getAttribute('length')); + $enc->height = clean($enclosure->getAttribute('height')); + $enc->width = clean($enclosure->getAttribute('width')); $medium = clean($enclosure->getAttribute("medium")); if (!$enc->type && $medium) { @@ -114,13 +117,12 @@ abstract class FeedItem_Common extends FeedItem { $content = $this->xpath->query("media:content", $enclosure)->item(0); if ($content) { - $enc = new FeedEnclosure( - type: clean($content->getAttribute('type')), - link: clean($content->getAttribute('url')), - length: clean($content->getAttribute('length')), - height: clean($content->getAttribute('height')), - width: clean($content->getAttribute('width')), - ); + $enc = new FeedEnclosure(); + $enc->type = clean($content->getAttribute('type')); + $enc->link = clean($content->getAttribute('url')); + $enc->length = clean($content->getAttribute('length')); + $enc->height = clean($content->getAttribute('height')); + $enc->width = clean($content->getAttribute('width')); $medium = clean($content->getAttribute("medium")); if (!$enc->type && $medium) { @@ -142,12 +144,13 @@ abstract class FeedItem_Common extends FeedItem { $enclosures = $this->xpath->query("media:thumbnail", $this->elem); foreach ($enclosures as $enclosure) { - $encs[] = new FeedEnclosure( - type: 'image/generic', - link: clean($enclosure->getAttribute('url')), - height: clean($enclosure->getAttribute('height')), - width: clean($enclosure->getAttribute('width')), - ); + $enc = new FeedEnclosure(); + $enc->type = 'image/generic'; + $enc->link = clean($enclosure->getAttribute('url')); + $enc->height = clean($enclosure->getAttribute('height')); + $enc->width = clean($enclosure->getAttribute('width')); + + array_push($encs, $enc); } return $encs; -- cgit v1.2.3-54-g00ecf