Changeset 7317

Show
Ignore:
Timestamp:
12/15/08 10:55:17 (2 years ago)
Author:
mickecarlsson
Message:

Closes #3443 adding check for uppercase file extensions

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/branches/2.6/music/page.music.php

    r7261 r7317  
    157157        $pattern = ''; 
    158158        $handle=opendir($path_to_dir) ; 
    159         $extensions = array('mp3','wav'); // list of extensions to match 
     159        $extensions = array('mp3','MP3','wav','WAV'); // list of extensions to match 
    160160         
    161161        //generate the pattern to look for. 
     
    205205 
    206206                        // If we are dealing with an MP3, we need to decode it to a wav file 
    207                         if (strpos($origmohfile,'.mp3') !== false)  {  
     207                        if (strpos($origmohfile,'.mp3') | strpos($origmohfile,'.MP3') !== false)  {  
    208208                                $mpg123cmd = "mpg123 -w \"".substr($origmohfile,0,strrpos($origmohfile,".")).".wav\" \"".$origmohfile."\" 2>&1 "; 
    209209                                exec($mpg123cmd, $output, $returncode); 
     
    211211                        $newmohfile = $path_to_dir."/wav_".$newname.".wav"; 
    212212                        //asdf 
    213                         $soxcmd = "sox \"".substr($origmohfile,0,strrpos($origmohfile,".")).".wav\""; 
     213                        $soxcmd = "sox \"".$origmohfile."\""; 
    214214                        $soxcmd .= " -r 8000 -c 1 \"".$newmohfile."\""; 
    215215                        if($volume){ 
     
    260260                // so we have two "original" files to delete 
    261261                // 
    262                 if (strpos($origmohfile,'.mp3') !== false)  { 
     262                if (strpos($origmohfile,'.mp3') | strpos($origmohfile,'.MP3') !== false)  { 
    263263                        $rmcmd="rm -f \"". substr($origmohfile,0,strrpos($origmohfile,".")).".wav\""; 
    264264                        exec($rmcmd);