Changeset 939

Show
Ignore:
Timestamp:
02/01/2006 02:37:31 PM (3 years ago)
Author:
dmorton
Message:

1.0 Branch: ref #264, [938] : initialize variables each time through the loop in case they are blank.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/1.0/scripts/send-quarantine-digests.pl

    r910 r939  
    290290                $rowcount = 0; 
    291291                while (@row = $sth->fetchrow_array()) { 
     292                    $token = $received_date = $score = $sender = $subject = ""; 
    292293                    $token = $1 if $row[0] =~  /^([a-zA-Z0-9]+)$/si; # untaint 
    293294                    $received_date = $1 if $row[1] =~ /^(\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2})$/si; # untaint 
     
    295296                    $sender = $1 if $row[3] =~ /^(.+\@.+\..+)$/si; # untaint 
    296297                    $subject = $1 if $row[4] =~ /^(.*)$/si; # untaint 
    297                     if ($subject eq "") { 
    298                         $subject = "(no subject)"; 
    299                     } 
     298        if ($received_date eq "") { 
     299          $received_date = "(no received_date)"; 
     300        } 
     301        if ($score eq "") { 
     302          $score = "(no score)"; 
     303        } 
     304        if ($sender eq "") { 
     305          $sender = "(no sender)"; 
     306        } 
     307        if ($subject eq "") { 
     308          $subject = "(no subject)"; 
     309        } 
    300310                     
    301311                    $vars{'list'}[$report_count]{$report_element}[$rowcount]{'token'} =  $token;