Changeset 1741

Show
Ignore:
Timestamp:
09/04/08 15:20:49 (3 months ago)
Author:
momo-i
Message:

Fixed #300 (Thx abs0) and Fixed didn't catch exception first analyze.

Location:
trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/docs/CHANGELOG

    r1732 r1741  
    55-------------------------------------------------------------------------- 
    66  v.3.5-Alpha1 
     7        - Fixed vainfo.class.php didn't catch exception for first analyze. 
     8        - Fixed iconv() returns an empty strings (Thx abs0) 
    79        - Updated getid3 for multi-byte characters, but some wrong id3tags 
    810                have occurred exception error. 
  • trunk/lib/class/vainfo.class.php

    r1732 r1741  
    6969 
    7070                // get id3tag encodings 
    71                 $this->_raw2 = $this->_getID3->analyze($file); 
     71                try { 
     72                        $this->_raw2 = $this->_getID3->analyze($file); 
     73                } 
     74                catch (Exception $error) { 
     75                        debug_event('getid3',$error->message,'1'); 
     76                } 
     77 
    7278                if(function_exists('mb_detect_encoding')) { 
    7379                        $this->encoding_id3v1 = array(); 
     
    567573                if ($this->_iconv) {  
    568574                        /* Guess that it's UTF-8 */ 
     575                        /* Try GNU iconv //TRANSLIT extension first */ 
    569576                        if (!$encoding) { $encoding = $this->_getID3->encoding; } 
    570577                        $charset = $this->encoding . '//TRANSLIT'; 
    571                         $tag = iconv($encoding,$charset,$tag); 
    572                 } 
    573  
    574                 return $tag; 
     578                        $enc_tag = iconv($encoding,$charset,$tag); 
     579                        if(strcmp($enc_tag, "") == 0) { 
     580                                $enc_tag = iconv($encoding,$this->encoding,$tag); 
     581                        } 
     582                } 
     583 
     584                return $enc_tag; 
    575585 
    576586        } // _clean_tag