Plugin Directory

Changeset 3439734


Ignore:
Timestamp:
01/14/2026 05:25:55 PM (2 months ago)
Author:
PierreLannoy
Message:

MailArchiver 4.4.0 released from GitHub

Location:
mailarchiver
Files:
16 edited
1 copied

Legend:

Unmodified
Added
Removed
  • mailarchiver/tags/4.4.0/CHANGELOG.md

    r3400895 r3439734  
    33
    44The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and **MailArchiver** adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
     5
     6## [4.4.0] - 2026-01-14
     7
     8### Added
     9- Compatibility with `name <email@example.com>` email addresses (thanks to [Willy Bahuaud](https://github.com/willybahuaud)).
     10
     11### Fixed
     12- [SEC005] XSS vulnerability in the "to" field (thanks to [Willy Bahuaud](https://github.com/willybahuaud)).
    513
    614## [4.3.0] - 2025-11-22
  • mailarchiver/tags/4.4.0/includes/features/class-capture.php

    r2606924 r3439734  
    4242     */
    4343    public function __construct() {
     44    }
     45
     46    /**
     47     * Normalizes "to" fields.
     48     *
     49     * @param   array  $tos    The tos.
     50     * @return  array  The normalized tos.
     51     * @since    4.4.0
     52     */
     53    private static function to( $tos ) {
     54        $result = [];
     55        if ( 0 < count( $tos ) ) {
     56            foreach ( $tos as $to ) {
     57                if ( str_contains( $to, '@' ) ) {
     58                    $result[] = $to;
     59                } else {
     60                    $result[] = '[malformed email address]';
     61                }
     62            }
     63        } else {
     64            $result[] = '[malformed email address]';
     65        }
     66        return $result;
    4467    }
    4568
     
    191214                $mail['from'] = self::from( $mail['headers'] );
    192215            }
     216            if ( array_key_exists( 'to', $mail ) ) {
     217                $mail['to'] = self::to( $mail['to'] );
     218            }
    193219            $mail['attachments'] = self::attachments( $mail['attachments'] );
    194220            $mail['headers']     = self::headers( $mail['headers'] );
  • mailarchiver/tags/4.4.0/includes/listeners/class-abstractlistener.php

    r2552008 r3439734  
    139139
    140140    /**
     141     * Recursively get all "to" email adresses.
     142     *
     143     * @since    4.3.1
     144     */
     145    protected function get_all_emails( $a, &$result ) {
     146        if ( is_array( $a ) ) {
     147            foreach ( $a as $item ) {
     148                $this->get_all_emails( $item, $result );
     149            }
     150        }
     151        if ( is_object( $a ) ) {
     152            foreach ( (array) $a as $item ) {
     153                $this->get_all_emails( $item, $result );
     154            }
     155        }
     156        if ( is_string( $a ) && str_contains( $a, '@' ) ) {
     157            if ( preg_match( "/[a-z0-9!#$%&'+\/=?^_{|}~-]+[a-z0-9!#$%&'*+\/.=?^_{|}~-]+@[\p{L}.-]+[\p{L}0-9]+/iu", $a, $matches ) ) {
     158                if ( 1 === count( $matches ) ) {
     159                    $result[] = $matches[0] ;
     160                }
     161            }
     162        }
     163    }
     164
     165    /**
    141166     * Sets the listener properties.
    142167     *
  • mailarchiver/tags/4.4.0/includes/listeners/class-corelistener.php

    r3195019 r3439734  
    110110
    111111    /**
    112      * Recursively get all "to" email adresses.
    113      *
    114      * @since    1.0.0
    115      */
    116     private function get_all_emails( $a, &$result ) {
    117         if ( is_array( $a ) ) {
    118             foreach ( $a as $item ) {
    119                 $this->get_all_emails( $item, $result );
    120             }
    121         }
    122         if ( is_object( $a ) ) {
    123             foreach ( (array) $a as $item ) {
    124                 $this->get_all_emails( $item, $result );
    125             }
    126         }
    127         if ( is_string( $a ) && false !== strpos( $a, '@' ) ) {
    128             $result[] = trim( $a) ;
    129         }
    130     }
    131 
    132     /**
    133112     * "wp_mail" event.
    134113     *
  • mailarchiver/tags/4.4.0/includes/listeners/class-wpmslistener.php

    r2552008 r3439734  
    6666
    6767    /**
    68      * Recursively get all "to" email adresses.
    69      *
    70      * @since    1.0.0
    71      */
    72     private function get_all_emails( $a, &$result ) {
    73         if ( is_array( $a ) ) {
    74             foreach ( $a as $item ) {
    75                 $this->get_all_emails( $item, $result );
    76             }
    77         }
    78         if ( is_object( $a ) ) {
    79             foreach ( (array) $a as $item ) {
    80                 $this->get_all_emails( $item, $result );
    81             }
    82         }
    83         if ( is_string( $a ) && false !== strpos( $a, '@' ) ) {
    84             $result[] = trim( $a) ;
    85         }
    86     }
    87 
    88     /**
    8968     * "phpmailer_init" action.
    9069     *
  • mailarchiver/tags/4.4.0/init.php

    r3400895 r3439734  
    1313define( 'MAILARCHIVER_PRODUCT_ABBREVIATION', 'mailarchiver' );
    1414define( 'MAILARCHIVER_SLUG', 'mailarchiver' );
    15 define( 'MAILARCHIVER_VERSION', '4.3.0' );
     15define( 'MAILARCHIVER_VERSION', '4.4.0' );
    1616define( 'MAILARCHIVER_MONOLOG_VERSION', '2.9.3' );
    1717define( 'MAILARCHIVER_CODENAME', '"-"' );
  • mailarchiver/tags/4.4.0/mailarchiver.php

    r3400895 r3439734  
    1111 * Plugin URI:        https://perfops.one/mailarchiver
    1212 * Description:       Automatically archive and store all emails sent from your site.
    13  * Version:           4.3.0
     13 * Version:           4.4.0
    1414 * Requires at least: 6.2
    1515 * Requires PHP:      8.1
  • mailarchiver/tags/4.4.0/readme.txt

    r3400895 r3439734  
    55Requires PHP: 8.1
    66Tested up to: 6.9
    7 Stable tag: 4.3.0
     7Stable tag: 4.4.0
    88License: GPLv3
    99License URI: https://www.gnu.org/licenses/gpl-3.0.html
  • mailarchiver/trunk/CHANGELOG.md

    r3400895 r3439734  
    33
    44The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and **MailArchiver** adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
     5
     6## [4.4.0] - 2026-01-14
     7
     8### Added
     9- Compatibility with `name <email@example.com>` email addresses (thanks to [Willy Bahuaud](https://github.com/willybahuaud)).
     10
     11### Fixed
     12- [SEC005] XSS vulnerability in the "to" field (thanks to [Willy Bahuaud](https://github.com/willybahuaud)).
    513
    614## [4.3.0] - 2025-11-22
  • mailarchiver/trunk/includes/features/class-capture.php

    r2606924 r3439734  
    4242     */
    4343    public function __construct() {
     44    }
     45
     46    /**
     47     * Normalizes "to" fields.
     48     *
     49     * @param   array  $tos    The tos.
     50     * @return  array  The normalized tos.
     51     * @since    4.4.0
     52     */
     53    private static function to( $tos ) {
     54        $result = [];
     55        if ( 0 < count( $tos ) ) {
     56            foreach ( $tos as $to ) {
     57                if ( str_contains( $to, '@' ) ) {
     58                    $result[] = $to;
     59                } else {
     60                    $result[] = '[malformed email address]';
     61                }
     62            }
     63        } else {
     64            $result[] = '[malformed email address]';
     65        }
     66        return $result;
    4467    }
    4568
     
    191214                $mail['from'] = self::from( $mail['headers'] );
    192215            }
     216            if ( array_key_exists( 'to', $mail ) ) {
     217                $mail['to'] = self::to( $mail['to'] );
     218            }
    193219            $mail['attachments'] = self::attachments( $mail['attachments'] );
    194220            $mail['headers']     = self::headers( $mail['headers'] );
  • mailarchiver/trunk/includes/listeners/class-abstractlistener.php

    r2552008 r3439734  
    139139
    140140    /**
     141     * Recursively get all "to" email adresses.
     142     *
     143     * @since    4.3.1
     144     */
     145    protected function get_all_emails( $a, &$result ) {
     146        if ( is_array( $a ) ) {
     147            foreach ( $a as $item ) {
     148                $this->get_all_emails( $item, $result );
     149            }
     150        }
     151        if ( is_object( $a ) ) {
     152            foreach ( (array) $a as $item ) {
     153                $this->get_all_emails( $item, $result );
     154            }
     155        }
     156        if ( is_string( $a ) && str_contains( $a, '@' ) ) {
     157            if ( preg_match( "/[a-z0-9!#$%&'+\/=?^_{|}~-]+[a-z0-9!#$%&'*+\/.=?^_{|}~-]+@[\p{L}.-]+[\p{L}0-9]+/iu", $a, $matches ) ) {
     158                if ( 1 === count( $matches ) ) {
     159                    $result[] = $matches[0] ;
     160                }
     161            }
     162        }
     163    }
     164
     165    /**
    141166     * Sets the listener properties.
    142167     *
  • mailarchiver/trunk/includes/listeners/class-corelistener.php

    r3195019 r3439734  
    110110
    111111    /**
    112      * Recursively get all "to" email adresses.
    113      *
    114      * @since    1.0.0
    115      */
    116     private function get_all_emails( $a, &$result ) {
    117         if ( is_array( $a ) ) {
    118             foreach ( $a as $item ) {
    119                 $this->get_all_emails( $item, $result );
    120             }
    121         }
    122         if ( is_object( $a ) ) {
    123             foreach ( (array) $a as $item ) {
    124                 $this->get_all_emails( $item, $result );
    125             }
    126         }
    127         if ( is_string( $a ) && false !== strpos( $a, '@' ) ) {
    128             $result[] = trim( $a) ;
    129         }
    130     }
    131 
    132     /**
    133112     * "wp_mail" event.
    134113     *
  • mailarchiver/trunk/includes/listeners/class-wpmslistener.php

    r2552008 r3439734  
    6666
    6767    /**
    68      * Recursively get all "to" email adresses.
    69      *
    70      * @since    1.0.0
    71      */
    72     private function get_all_emails( $a, &$result ) {
    73         if ( is_array( $a ) ) {
    74             foreach ( $a as $item ) {
    75                 $this->get_all_emails( $item, $result );
    76             }
    77         }
    78         if ( is_object( $a ) ) {
    79             foreach ( (array) $a as $item ) {
    80                 $this->get_all_emails( $item, $result );
    81             }
    82         }
    83         if ( is_string( $a ) && false !== strpos( $a, '@' ) ) {
    84             $result[] = trim( $a) ;
    85         }
    86     }
    87 
    88     /**
    8968     * "phpmailer_init" action.
    9069     *
  • mailarchiver/trunk/init.php

    r3400895 r3439734  
    1313define( 'MAILARCHIVER_PRODUCT_ABBREVIATION', 'mailarchiver' );
    1414define( 'MAILARCHIVER_SLUG', 'mailarchiver' );
    15 define( 'MAILARCHIVER_VERSION', '4.3.0' );
     15define( 'MAILARCHIVER_VERSION', '4.4.0' );
    1616define( 'MAILARCHIVER_MONOLOG_VERSION', '2.9.3' );
    1717define( 'MAILARCHIVER_CODENAME', '"-"' );
  • mailarchiver/trunk/mailarchiver.php

    r3400895 r3439734  
    1111 * Plugin URI:        https://perfops.one/mailarchiver
    1212 * Description:       Automatically archive and store all emails sent from your site.
    13  * Version:           4.3.0
     13 * Version:           4.4.0
    1414 * Requires at least: 6.2
    1515 * Requires PHP:      8.1
  • mailarchiver/trunk/readme.txt

    r3400895 r3439734  
    55Requires PHP: 8.1
    66Tested up to: 6.9
    7 Stable tag: 4.3.0
     7Stable tag: 4.4.0
    88License: GPLv3
    99License URI: https://www.gnu.org/licenses/gpl-3.0.html
Note: See TracChangeset for help on using the changeset viewer.