]> git.parisson.com Git - telemeta.git/commitdiff
eztelemeta: suppress warning caused by empty dc elements
authorolivier <>
Tue, 14 Apr 2009 16:32:17 +0000 (16:32 +0000)
committerolivier <>
Tue, 14 Apr 2009 16:32:17 +0000 (16:32 +0000)
tools/eztelemeta/datatypes/eztelemetaitem/eztelemetaitemtype.php

index 57c418b300575474e397852026884bd07d46bc87..8e859e8068298dab63f495ad9b6fa736db2f89ef 100755 (executable)
@@ -109,7 +109,7 @@ class eZTelemetaItemType extends eZDataType
         foreach ($dc->childNodes as $element) {
             if ($element->nodeType == XML_ELEMENT_NODE) {
                 $tag    = str_replace('dc:', '', $element->tagName);
-                $value  = trim($element->firstChild->nodeValue);
+                $value  = $element->childNodes->length ? trim($element->firstChild->nodeValue) : '';
                 if ($tag == 'format' and ereg('^([0-9]{2}):([0-9]{2}):([0-9]{2})$', $value, $regs)) {
                     $tag    = 'duration';
                     $value  = $regs[1] * 3600 + $regs[2] * 60 + $regs[3];