function atom_03_construct_type($attribs)
{
if (isset($attribs['']['mode']) && strtolower(trim($attribs['']['mode']) === 'base64')) {
$mode = SIMPLEPIE_CONSTRUCT_BASE64;
} else {
$mode = SIMPLEPIE_CONSTRUCT_NONE;
}
if (isset($attribs['']['type'])) {
switch (strtolower(trim($attribs['']['type']))) {
case 'text':
case 'text/plain':
return SIMPLEPIE_CONSTRUCT_TEXT | $mode;
case 'html':
case 'text/html':
return SIMPLEPIE_CONSTRUCT_HTML | $mode;
case 'xhtml':
case 'application/xhtml+xml':
return SIMPLEPIE_CONSTRUCT_XHTML | $mode;
default:
return SIMPLEPIE_CONSTRUCT_NONE | $mode;
}
} else {
return SIMPLEPIE_CONSTRUCT_TEXT | $mode;
}
}
public function get_content($content_only = false) { if ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'content')) { return $this->sanitize($return[0]['data'], SimplePie_Misc::atom_10_content_construct_type($return[0]['attribs']), $this->get_base($return[0])); } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'content')) { return $this->sanitize($return[0]['data'], SimplePie_Misc::atom_03_construct_type($return[0]['attribs']), $this->get_base($return[0])); } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_10_MODULES_CONTENT, 'encoded')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_HTML, $this->get_base($return[0])); } elseif (!$content_only) { return $this->get_description(true); } else { return null; } }