Changeset 252

Show
Ignore:
Timestamp:
08/31/06 00:12:46 (2 years ago)
Author:
miya
Message:

Filter::FFmpeg: Fixed to rewrite filename to the safer one.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plagger/trunk/lib/Plagger/Plugin/Filter/FFmpeg.pm

    r251 r252  
    3737    } 
    3838 
     39    $file = $self->safe_filename($file); 
    3940 
    4041    my $ff = FFmpeg::Command->new($self->conf->{command}); 
     
    6566    $e->enclosure->filename("$file.$ext"); 
    6667    $e->enclosure->type( Plagger::Util::mime_type_of($ext) ); 
     68} 
     69 
     70sub safe_filename { 
     71    my($self, $path) = @_; 
     72    $path =~ s![^\w\s]+!_!g; 
     73    $path =~ s!\s+!_!g; 
     74    $path; 
    6775} 
    6876