Huge rewrite of default parameters, ext-network continued:
[mailer.git] / inc / phpmailer / class.phpmailer.php
index 114effae2eee232351b37f14b953db15e1b31f55..6939fc2c8a3320ec239cabec75936aa0b6491c46 100644 (file)
@@ -114,7 +114,7 @@ class PHPMailer {
    * characters.
    * @var int
    */
-  var $WordWrap          = 0;
+  var $WordWrap          = '0';
 
   /**
    * Method to send mail: ("mail", "sendmail", or "smtp").
@@ -255,7 +255,7 @@ class PHPMailer {
   var $message_type    = '';
   var $boundary        = array();
   var $language        = array();
-  var $error_count     = 0;
+  var $error_count     = '0';
   var $LE              = "\r\n";
   var $sign_cert_file  = "";
   var $sign_key_file   = "";
@@ -392,7 +392,7 @@ class PHPMailer {
       $this->ContentType = 'multipart/alternative';
     }
 
-    $this->error_count = 0; // reset errors
+    $this->error_count = '0'; // reset errors
     $this->SetMessageType();
     $header .= $this->CreateHeader();
     $body = $this->CreateBody();
@@ -462,7 +462,7 @@ class PHPMailer {
   function MailSend($header, $body) {
 
     $to = '';
-    for($i = 0; $i < count($this->to); $i++) {
+    for($i = '0'; $i < count($this->to); $i++) {
       if($i != 0) { $to .= ', '; }
       $to .= $this->AddrFormat($this->to[$i]);
     }
@@ -527,24 +527,24 @@ class PHPMailer {
     }
 
     /* Attempt to send attach all recipients */
-    for($i = 0; $i < count($this->to); $i++) {
+    for($i = '0'; $i < count($this->to); $i++) {
       if(!$this->smtp->Recipient($this->to[$i][0])) {
         $bad_rcpt[] = $this->to[$i][0];
       }
     }
-    for($i = 0; $i < count($this->cc); $i++) {
+    for($i = '0'; $i < count($this->cc); $i++) {
       if(!$this->smtp->Recipient($this->cc[$i][0])) {
         $bad_rcpt[] = $this->cc[$i][0];
       }
     }
-    for($i = 0; $i < count($this->bcc); $i++) {
+    for($i = '0'; $i < count($this->bcc); $i++) {
       if(!$this->smtp->Recipient($this->bcc[$i][0])) {
         $bad_rcpt[] = $this->bcc[$i][0];
       }
     }
 
     if(count($bad_rcpt) > 0) { // Create error message
-      for($i = 0; $i < count($bad_rcpt); $i++) {
+      for($i = '0'; $i < count($bad_rcpt); $i++) {
         if($i != 0) {
           $error .= ', ';
         }
@@ -583,7 +583,7 @@ class PHPMailer {
 
     $this->smtp->do_debug = $this->SMTPDebug;
     $hosts = explode(';', $this->Host);
-    $index = 0;
+    $index = '0';
     $connection = ($this->smtp->Connected());
 
     /* Retry while there is no connection */
@@ -730,7 +730,7 @@ class PHPMailer {
     for ($i=0 ;$i < count($line); $i++) {
       $line_part = explode(' ', $line[$i]);
       $buf = '';
-      for ($e = 0; $e<count($line_part); $e++) {
+      for ($e = '0'; $e<count($line_part); $e++) {
         $word = $line_part[$e];
         if ($qp_mode and (strlen($word) > $length)) {
           $space_left = $length - strlen($buf) - 1;
@@ -773,7 +773,7 @@ class PHPMailer {
           }
         } else {
           $buf_o = $buf;
-          $buf .= ($e == 0) ? $word : (' ' . $word);
+          $buf .= ($e == '0') ? $word : (' ' . $word);
 
           if (strlen($buf) > $length and $buf_o != '') {
             $message .= $buf_o . $soft_break;
@@ -810,7 +810,7 @@ class PHPMailer {
         if ($dec < 128) { // Single byte character.
           // If the encoded char was found at pos 0, it will fit
           // otherwise reduce maxLength to start of the encoded char
-          $maxLength = ($encodedCharPos == 0) ? $maxLength :
+          $maxLength = ($encodedCharPos == '0') ? $maxLength :
           $maxLength - ($lookBack - $encodedCharPos);
           $foundSplitPos = true;
         } elseif ($dec >= 192) { // First byte of a multi byte character
@@ -874,7 +874,7 @@ class PHPMailer {
     if($this->Mailer != 'mail') {
       if(count($this->to) > 0) {
         $result .= $this->AddrAppend('To', $this->to);
-      } elseif (count($this->cc) == 0) {
+      } elseif (count($this->cc) == '0') {
         $result .= $this->HeaderLine('To', 'undisclosed-recipients:;');
       }
     }
@@ -916,7 +916,7 @@ class PHPMailer {
     }
 
     // Add custom headers
-    for($index = 0; $index < count($this->CustomHeader); $index++) {
+    for($index = '0'; $index < count($this->CustomHeader); $index++) {
       $result .= $this->HeaderLine(trim($this->CustomHeader[$index][0]), $this->EncodeHeader(trim($this->CustomHeader[$index][1])));
     }
     if (!$this->sign_key_file) {
@@ -1140,7 +1140,7 @@ class PHPMailer {
     $this->attachment[$cur][4] = $type;
     $this->attachment[$cur][5] = false; // isStringAttachment
     $this->attachment[$cur][6] = 'attachment';
-    $this->attachment[$cur][7] = 0;
+    $this->attachment[$cur][7] = '0';
 
     return true;
   }
@@ -1156,7 +1156,7 @@ class PHPMailer {
     $mime = array();
 
     /* Add all attachments */
-    for($i = 0; $i < count($this->attachment); $i++) {
+    for($i = '0'; $i < count($this->attachment); $i++) {
       /* Check for string attachment */
       $bString = $this->attachment[$i][5];
       if ($bString) {
@@ -1262,7 +1262,7 @@ class PHPMailer {
    * @return string
    */
   function EncodeHeader ($str, $position = 'text') {
-    $x = 0;
+    $x = '0';
 
     switch (strtolower($position)) {
       case 'phrase':
@@ -1286,7 +1286,7 @@ class PHPMailer {
         break;
     }
 
-    if ($x == 0) {
+    if ($x == '0') {
       return ($str);
     }
 
@@ -1351,8 +1351,8 @@ class PHPMailer {
     // Base64 has a 4:3 ratio
     $offset = $avgLength = floor($length * $ratio * .75);
 
-    for ($i = 0; $i < $mb_length; $i += $offset) {
-      $lookBack = 0;
+    for ($i = '0'; $i < $mb_length; $i += $offset) {
+      $lookBack = '0';
 
       do {
         $offset = $avgLength - $lookBack;
@@ -1384,10 +1384,10 @@ class PHPMailer {
     while( list(, $line) = each($lines) ) {
       $linlen = strlen($line);
       $newline = '';
-      for($i = 0; $i < $linlen; $i++) {
+      for($i = '0'; $i < $linlen; $i++) {
         $c = substr( $line, $i, 1 );
         $dec = ord( $c );
-        if ( ( $i == 0 ) && ( $dec == 46 ) ) { // convert first point in the line into =2E
+        if ( ( $i == '0' ) && ( $dec == 46 ) ) { // convert first point in the line into =2E
           $c = '=2E';
         }
         if ( $dec == 32 ) {
@@ -1465,7 +1465,7 @@ class PHPMailer {
     $this->attachment[$cur][4] = $type;
     $this->attachment[$cur][5] = true; // isString
     $this->attachment[$cur][6] = 'attachment';
-    $this->attachment[$cur][7] = 0;
+    $this->attachment[$cur][7] = '0';
   }
 
   /**
@@ -1514,7 +1514,7 @@ class PHPMailer {
    */
   function InlineImageExists() {
     $result = false;
-    for($i = 0; $i < count($this->attachment); $i++) {
+    for($i = '0'; $i < count($this->attachment); $i++) {
       if($this->attachment[$i][6] == 'inline') {
         $result = true;
         break;