Changeset 5231


Ignore:
Timestamp:
03/21/10 22:15:57 (10 years ago)
Author:
grum
Message:

fix bug when formating dates : invalid dates are now ignored (forgotten to commit this file)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/AMetaData/JpegMetaData/Readers/IptcReader.class.php

    r4904 r5231  
    131131           * can't use the timestamp function because not compatible with php < 5.3 
    132132           */ 
    133           $this->entries[$tagD]->getLabel()->setTime( 
    134             (int)$this->entries[$tagT]->getLabel()->format("H"), 
    135             (int)$this->entries[$tagT]->getLabel()->format("i"), 
    136             (int)$this->entries[$tagT]->getLabel()->format("s") 
    137           ); 
     133          if($this->entries[$tagD]->getLabel() instanceof DateTime) 
     134          { 
     135            $this->entries[$tagD]->getLabel()->setTime( 
     136              (int)$this->entries[$tagT]->getLabel()->format("H"), 
     137              (int)$this->entries[$tagT]->getLabel()->format("i"), 
     138              (int)$this->entries[$tagT]->getLabel()->format("s") 
     139            ); 
     140          } 
    138141          array_splice($this->entries, $tagT, 1); 
    139142        } 
Note: See TracChangeset for help on using the changeset viewer.