Changeset 111

Show
Ignore:
Timestamp:
12.12.2006 00:10:58 (2 years ago)
Author:
jorge
Message:

Fixed: generate safe filenames by translating odd characters to underscores.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/devel/FuzzyOcr.pm

    r110 r111  
    258258        #Generete unique filename to store image 
    259259        my $imgfilename = Mail::SpamAssassin::Util::untaint_file_path( 
    260             $imgdir . "/" . $fname 
     260            $imgdir . "/" . $filename 
    261261        ); 
    262262        my $unique = 0; 
    263263        while (-e $imgfilename) { 
    264264            $imgfilename = Mail::SpamAssassin::Util::untaint_file_path( 
    265                 $imgdir . "/" . chr(65+$unique) . "." . $fname 
     265                $imgdir . "/" . chr(65+$unique) . "." . $filename 
    266266            ); 
    267267            $unique++; 
    268268        } 
    269  
    270         #Translate spaces to underscores, otherwise will break $input later on. 
    271         $imgfilename =~ s/ /_/g; 
    272269 
    273270        #Save important constants