Browse Source

catch bad dc.. or qdc

pull/224/head
Kris Bulman 12 years ago
parent
commit
e8a450e346
  1. 5
      includes/DublinCore.inc

5
includes/DublinCore.inc

@ -39,7 +39,7 @@ class DublinCore {
* @param string $dc_xml
*/
function DublinCore($dc_xml = NULL) {
if (!empty($dc_string)) {
if (!empty($dc_xml)) {
$this->dc = self::import_from_xml_string($dc_xml);
}
}
@ -145,9 +145,12 @@ class DublinCore {
if ($dc_doc->loadXML($dc_xml)) {
$oai_dc = $dc_doc->getElementsByTagNameNS('http://purl.org/dc/elements/1.1/', '*');
$new_dc = new DublinCore();
foreach ($oai_dc as $child) {
if(isset($new_dc->dc[$child->nodeName])) {
array_push($new_dc->dc[$child->nodeName], $child->nodeValue);
}
}
return $new_dc;
}
else {

Loading…
Cancel
Save