phpBMS

Changeset 680 for trunk

Show
Ignore:
Timestamp:
12/15/09 13:08:42 (2 years ago)
Author:
nate
Message:
  • Fixed an error that would cause an infinite loop.
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/phpbms/modules/mailchimp/include/list_sync.php

    r677 r680  
    115115         
    116116        $tempArray["message"] = $message; 
    117         if($errorCode !== NULL) 
    118             $tempArray["code"] = $errorCode; 
     117        $tempArray["code"] = $errorCode; 
    119118         
    120119        $this->errors[] = $tempArray; 
     
    276275          *  pull all the subscribed  
    277276          */ 
     277        $i = 0; 
    278278        do{     
    279279            $valuesClause = ""; 
    280280             
    281             $members = $this->api->listMembers($this->listId, 'subscribed', NULL, 0, $this->batchLimit); 
     281            $members = $this->api->listMembers($this->listId, 'subscribed', NULL, $i*$this->batchLimit, $this->batchLimit*($i+1)); 
    282282 
    283283            if($this->api->errorCode){ 
     
    294294              *  Put the subscribed into a temporary table  
    295295              */ 
    296             $insertStatement = " 
    297                 INSERT INTO 
    298                     `tempEmail` 
    299                 (`email`) 
    300                     VALUES 
    301                 ".$valuesClause; 
    302              
    303             $this->db->query($insertStatement); 
    304              
     296            if($valuesClause){ 
     297                $insertStatement = " 
     298                    INSERT INTO 
     299                        `tempEmail` 
     300                    (`email`) 
     301                        VALUES 
     302                    ".$valuesClause; 
     303                 
     304                $this->db->query($insertStatement); 
     305            }//end if 
     306             
     307            $i++; 
    305308        }while(count($members) == $this->batchLimit); 
    306309 
phpBMS vulnerability assesment provided by Orvant Inc. Copyright © 2010 Kreotek, LLC. All Rights reserved.