rename unfairly prefixed get_enclosures() in feeditem

This commit is contained in:
Andrew Dolgov 2021-03-05 09:35:17 +03:00
parent c744cfe2dc
commit e8e6329040
5 changed files with 7 additions and 7 deletions

View File

@ -9,7 +9,7 @@ abstract class FeedItem {
abstract function get_comments_url();
abstract function get_comments_count();
abstract function get_categories();
abstract function _get_enclosures();
abstract function get_enclosures();
abstract function get_author();
abstract function get_language();
}

View File

@ -119,7 +119,7 @@ class FeedItem_Atom extends FeedItem_Common {
return $this->normalize_categories($cats);
}
function _get_enclosures() {
function get_enclosures() {
$links = $this->elem->getElementsByTagName("link");
$encs = array();
@ -138,7 +138,7 @@ class FeedItem_Atom extends FeedItem_Common {
}
}
$encs = array_merge($encs, parent::_get_enclosures());
$encs = array_merge($encs, parent::get_enclosures());
return $encs;
}

View File

@ -78,7 +78,7 @@ abstract class FeedItem_Common extends FeedItem {
}
// this is common for both Atom and RSS types and deals with various media: elements
function _get_enclosures() {
function get_enclosures() {
$encs = [];
$enclosures = $this->xpath->query("media:content", $this->elem);

View File

@ -112,7 +112,7 @@ class FeedItem_RSS extends FeedItem_Common {
return $this->normalize_categories($cats);
}
function _get_enclosures() {
function get_enclosures() {
$enclosures = $this->elem->getElementsByTagName("enclosure");
$encs = array();
@ -129,7 +129,7 @@ class FeedItem_RSS extends FeedItem_Common {
array_push($encs, $enc);
}
$encs = array_merge($encs, parent::_get_enclosures());
$encs = array_merge($encs, parent::get_enclosures());
return $encs;
}

View File

@ -744,7 +744,7 @@ class RSSUtils {
$enclosures = array();
$encs = $item->_get_enclosures();
$encs = $item->get_enclosures();
if (is_array($encs)) {
foreach ($encs as $e) {