Plugin Directory

Changeset 3442745


Ignore:
Timestamp:
01/19/2026 06:51:09 PM (2 months ago)
Author:
bgermann
Message:

import version 15.1.2

Location:
cforms2/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • cforms2/trunk/Email.php

    r3441570 r3442745  
    152152    }
    153153
    154     private function mail_header() {
     154    private function mail_header($boundary = '') {
    155155        $r = array();
    156156
     
    164164        $r[] = (count($this->replyto) > 0) ? $this->addr_add('Reply-to', $this->replyto) : '';
    165165
    166         $r[] = sprintf("Content-Type: %s", $this->content_type);
     166        if ($boundary !== '') {
     167            $r[] = sprintf('Content-Type: multipart/alternative; boundary="%s"', $boundary);
     168        } else {
     169            $r[] = sprintf('Content-Type: %s', $this->content_type);
     170        }
    167171        return $r;
    168172
     
    185189        }
    186190
    187         $header = $this->mail_header();
    188191        $body = $this->mail_body($this->body);
    189192        $body_alt = $this->mail_body($this->body_alt);
     
    199202        // Use multipart/alternative format if both HTML and plain text are available
    200203        if ($body_alt !== '') {
    201             $body = array('html' => $body, 'text' => $body_alt);
    202         }
    203         $rt = wp_mail($to, $this->fix_header($this->subj), $body, $header, $this->up);
     204            $boundary = 'cforms2_' . md5(uniqid());
     205
     206            $header = $this->mail_header($boundary);
     207            $mimebody = "--$boundary\r\n";
     208            $mimebody .= "Content-Type: text/plain; charset=" . get_bloginfo('charset') . "\r\n\r\n";
     209            $mimebody .= $body_alt . "\r\n\r\n";
     210            $mimebody .= "--$boundary\r\n";
     211            $mimebody .= "Content-Type: text/html; charset=" . get_bloginfo('charset') . "\r\n\r\n";
     212            $mimebody .= $body . "\r\n\r\n";
     213            $mimebody .= "--$boundary--";
     214        } else {
     215            $header = $this->mail_header();
     216            $mimebody = $body;
     217        }
     218
     219        $rt = wp_mail($to, $this->fix_header($this->subj), $mimebody, $header, $this->up);
    204220
    205221        if (!$rt) {
  • cforms2/trunk/cforms.php

    r3442099 r3442745  
    2121 * Description: cformsII is a customizable, flexible and powerful form plugin including simple spam protection, multi-step forms, role manager support and custom themes.
    2222 * Author: Oliver Seidel, Bastian Germann
    23  * Version: 15.1.1
     23 * Version: 15.1.2
    2424 * Requires at least: 6.9
    2525 * Text Domain: cforms2
     
    2727namespace Cforms2;
    2828
    29 define('CFORMS2_VERSION', '15.1.1');
     29define('CFORMS2_VERSION', '15.1.2');
    3030
    3131// Debug message handling.
  • cforms2/trunk/lib_aux.php

    r2353696 r3442745  
    118118        } elseif (strpos($k, 'Fieldset') !== false) {
    119119            $space = '-';
    120             $n = ((($customspace * 2) + 2) - strlen(strip_tags($v))) / 2;
     120            $n = (int) (((($customspace * 2) + 2) - strlen(strip_tags($v))) / 2);
    121121            $n = ($n < 0) ? 0 : $n;
    122122            if (strlen(strip_tags($v)) < (($customspace * 2) - 2))
  • cforms2/trunk/readme.txt

    r3442099 r3442745  
    8787== Upgrade Notice ==
    8888
    89 = 15.1.1 =
     89= 15.1.2 =
    9090The tracking database feature and its view are removed with cformsII 15.0+. Your data still exists in the database. Please have a look at CFDB plugin as a replacement.
    9191
    9292
    9393== Changelog ==
     94
     95= 15.1.2 =
     96
     97* bugfix:   Construct multipart/alternative emails
    9498
    9599= 15.1.1 =
Note: See TracChangeset for help on using the changeset viewer.