: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
if (isset($category['data']))
$term = $this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT);
if (isset($category['attribs']['']['scheme']))
$scheme = $this->sanitize($category['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT);
$scheme = 'http://search.yahoo.com/mrss/category_schema';
if (isset($category['attribs']['']['label']))
$label = $this->sanitize($category['attribs']['']['label'], SIMPLEPIE_CONSTRUCT_TEXT);
$categories[] = $this->registry->create('Category', array($term, $scheme, $label));
if (is_array($categories) && is_array($categories_parent))
$categories = array_values(array_unique(array_merge($categories, $categories_parent)));
elseif (is_array($categories))
$categories = array_values(array_unique($categories));
elseif (is_array($categories_parent))
$categories = array_values(array_unique($categories_parent));
if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright']))
if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['attribs']['']['url']))
$copyright_url = $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_TEXT);
if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['data']))
$copyright_label = $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
$copyrights = $this->registry->create('Copyright', array($copyright_url, $copyright_label));
$copyrights = $copyrights_parent;
if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['credit']))
foreach ($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['credit'] as $credit)
if (isset($credit['attribs']['']['role']))
$credit_role = $this->sanitize($credit['attribs']['']['role'], SIMPLEPIE_CONSTRUCT_TEXT);
if (isset($credit['attribs']['']['scheme']))
$credit_scheme = $this->sanitize($credit['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT);
$credit_scheme = 'urn:ebu';
if (isset($credit['data']))
$credit_name = $this->sanitize($credit['data'], SIMPLEPIE_CONSTRUCT_TEXT);
$credits[] = $this->registry->create('Credit', array($credit_role, $credit_scheme, $credit_name));
$credits = array_values(array_unique($credits));
$credits = $credits_parent;
if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['description']))
$description = $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['description'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
$description = $description_parent;
if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['hash']))
foreach ($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['hash'] as $hash)
if (isset($hash['data']))
$value = $this->sanitize($hash['data'], SIMPLEPIE_CONSTRUCT_TEXT);
if (isset($hash['attribs']['']['algo']))
$algo = $this->sanitize($hash['attribs']['']['algo'], SIMPLEPIE_CONSTRUCT_TEXT);
$hashes[] = $algo.':'.$value;
$hashes = array_values(array_unique($hashes));
$hashes = $hashes_parent;
if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['keywords']))
if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['keywords'][0]['data']))
$temp = explode(',', $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['keywords'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT));
$keywords[] = trim($word);
$keywords = array_values(array_unique($keywords));
$keywords = $keywords_parent;
if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['player']))
if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['player'][0]['attribs']['']['url'])) {
$player = $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['player'][0]['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI);
$player = $player_parent;
if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['rating']))
foreach ($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['rating'] as $rating)
if (isset($rating['attribs']['']['scheme']))
$rating_scheme = $this->sanitize($rating['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT);
$rating_scheme = 'urn:simple';
if (isset($rating['data']))
$rating_value = $this->sanitize($rating['data'], SIMPLEPIE_CONSTRUCT_TEXT);
$ratings[] = $this->registry->create('Rating', array($rating_scheme, $rating_value));
$ratings = array_values(array_unique($ratings));
$ratings = $ratings_parent;
if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['restriction']))
foreach ($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['restriction'] as $restriction)
$restriction_relationship = null;
$restriction_type = null;
$restriction_value = null;
if (isset($restriction['attribs']['']['relationship']))
$restriction_relationship = $this->sanitize($restriction['attribs']['']['relationship'], SIMPLEPIE_CONSTRUCT_TEXT);
if (isset($restriction['attribs']['']['type']))
$restriction_type = $this->sanitize($restriction['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT);
if (isset($restriction['data']))
$restriction_value = $this->sanitize($restriction['data'], SIMPLEPIE_CONSTRUCT_TEXT);
$restrictions[] = $this->registry->create('Restriction', array($restriction_relationship, $restriction_type, $restriction_value));
if (is_array($restrictions))
$restrictions = array_values(array_unique($restrictions));
$restrictions = $restrictions_parent;
if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['thumbnail']))
foreach ($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['thumbnail'] as $thumbnail)
if (isset($thumbnail['attribs']['']['url'])) {
$thumbnails[] = $this->sanitize($thumbnail['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI);
if (is_array($thumbnails))
$thumbnails = array_values(array_unique($thumbnails));
$thumbnails = $thumbnails_parent;
if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['title']))
$title = $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['title'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
$this->data['enclosures'][] = $this->registry->create('Enclosure', array($url, $type, $length, null, $bitrate, $captions, $categories, $channels, $copyrights, $credits, $description, $duration, $expression, $framerate, $hashes, $height, $keywords, $lang, $medium, $player, $ratings, $restrictions, $samplingrate, $thumbnails, $title, $width));
foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'link') as $link)
if (isset($link['attribs']['']['href']) && !empty($link['attribs']['']['rel']) && $link['attribs']['']['rel'] === 'enclosure')
$url = $this->sanitize($link['attribs']['']['href'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($link));
if (isset($link['attribs']['']['type']))
$type = $this->sanitize($link['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT);
if (isset($link['attribs']['']['length']))
$length = intval($link['attribs']['']['length']);
if (isset($link['attribs']['']['title']))
$title = $this->sanitize($link['attribs']['']['title'], SIMPLEPIE_CONSTRUCT_TEXT);
// Since we don't have group or content for these, we'll just pass the '*_parent' variables directly to the constructor
$this->data['enclosures'][] = $this->registry->create('Enclosure', array($url, $type, $length, null, $bitrate, $captions_parent, $categories_parent, $channels, $copyrights_parent, $credits_parent, $description_parent, $duration_parent, $expression, $framerate, $hashes_parent, $height, $keywords_parent, $lang, $medium, $player_parent, $ratings_parent, $restrictions_parent, $samplingrate, $thumbnails_parent, $title, $width));
foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'link') as $link)
if (isset($link['attribs']['']['href']) && !empty($link['attribs']['']['rel']) && $link['attribs']['']['rel'] === 'enclosure')
$url = $this->sanitize($link['attribs']['']['href'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($link));
if (isset($link['attribs']['']['type']))
$type = $this->sanitize($link['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT);
if (isset($link['attribs']['']['length']))
$length = intval($link['attribs']['']['length']);
// Since we don't have group or content for these, we'll just pass the '*_parent' variables directly to the constructor
$this->data['enclosures'][] = $this->registry->create('Enclosure', array($url, $type, $length, null, $bitrate, $captions_parent, $categories_parent, $channels, $copyrights_parent, $credits_parent, $description_parent, $duration_parent, $expression, $framerate, $hashes_parent, $height, $keywords_parent, $lang, $medium, $player_parent, $ratings_parent, $restrictions_parent, $samplingrate, $thumbnails_parent, $title_parent, $width));
if ($enclosure = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'enclosure'))
if (isset($enclosure[0]['attribs']['']['url']))
$url = $this->sanitize($enclosure[0]['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($enclosure[0]));
$url = $this->feed->sanitize->https_url($url);
if (isset($enclosure[0]['attribs']['']['type']))
$type = $this->sanitize($enclosure[0]['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT);
if (isset($enclosure[0]['attribs']['']['length']))
$length = intval($enclosure[0]['attribs']['']['length']);
// Since we don't have group or content for these, we'll just pass the '*_parent' variables directly to the constructor
$this->data['enclosures'][] = $this->registry->create('Enclosure', array($url, $type, $length, null, $bitrate, $captions_parent, $categories_parent, $channels, $copyrights_parent, $credits_parent, $description_parent, $duration_parent, $expression, $framerate, $hashes_parent, $height, $keywords_parent, $lang, $medium, $player_parent, $ratings_parent, $restrictions_parent, $samplingrate, $thumbnails_parent, $title_parent, $width));
if (sizeof($this->data['enclosures']) === 0 && ($url || $type || $length || $bitrate || $captions_parent || $categories_parent || $channels || $copyrights_parent || $credits_parent || $description_parent || $duration_parent || $expression || $framerate || $hashes_parent || $height || $keywords_parent || $lang || $medium || $player_parent || $ratings_parent || $restrictions_parent || $samplingrate || $thumbnails_parent || $title_parent || $width))
// Since we don't have group or content for these, we'll just pass the '*_parent' variables directly to the constructor
$this->data['enclosures'][] = $this->registry->create('Enclosure', array($url, $type, $length, null, $bitrate, $captions_parent, $categories_parent, $channels, $copyrights_parent, $credits_parent, $description_parent, $duration_parent, $expression, $framerate, $hashes_parent, $height, $keywords_parent, $lang, $medium, $player_parent, $ratings_parent, $restrictions_parent, $samplingrate, $thumbnails_parent, $title_parent, $width));
$this->data['enclosures'] = array_values(array_unique($this->data['enclosures']));
if (!empty($this->data['enclosures']))
return $this->data['enclosures'];
* Get the latitude coordinates for the item
* Compatible with the W3C WGS84 Basic Geo and GeoRSS specifications
* Uses `<geo:lat>` or `<georss:point>`
* @link http://www.w3.org/2003/01/geo/ W3C WGS84 Basic Geo
* @link http://www.georss.org/ GeoRSS
public function get_latitude()
if ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_W3C_BASIC_GEO, 'lat'))
return (float) $return[0]['data'];
elseif (($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_GEORSS, 'point')) && preg_match('/^((?:-)?[0-9]+(?:\.[0-9]+)) ((?:-)?[0-9]+(?:\.[0-9]+))$/', trim($return[0]['data']), $match))
return (float) $match[1];
* Get the longitude coordinates for the item
* Compatible with the W3C WGS84 Basic Geo and GeoRSS specifications
* Uses `<geo:long>`, `<geo:lon>` or `<georss:point>`
* @link http://www.w3.org/2003/01/geo/ W3C WGS84 Basic Geo
* @link http://www.georss.org/ GeoRSS
public function get_longitude()
if ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_W3C_BASIC_GEO, 'long'))
return (float) $return[0]['data'];
elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_W3C_BASIC_GEO, 'lon'))
return (float) $return[0]['data'];
elseif (($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_GEORSS, 'point')) && preg_match('/^((?:-)?[0-9]+(?:\.[0-9]+)) ((?:-)?[0-9]+(?:\.[0-9]+))$/', trim($return[0]['data']), $match))
return (float) $match[2];
* Get the `<atom:source>` for the item
* @return SimplePie_Source|null
public function get_source()
if ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'source'))
return $this->registry->create('Source', array($this, $return[0]));