Plugin Directory

Changeset 3058117


Ignore:
Timestamp:
03/25/2024 09:35:43 AM (2 years ago)
Author:
haet
Message:

3.4.7

  • ADDED: Support for Fluent Support Mailbox mails
  • FIXED: EDD Pro not recognized as active
  • FIXED: display error when sending e-mails with FluentCRM automation
  • updated dependencies to fix a notice in PHP 8.1
Location:
wp-html-mail
Files:
488 added
55 edited

Legend:

Unmodified
Added
Removed
  • wp-html-mail/trunk/includes/class-haet-mail.php

    r2973684 r3058117  
    493493        );
    494494
     495        // check if the email content contains the mailbuilder comment
     496        // if so we don't use the template twice if emails are resent for some reason
     497        if( strpos( $email['message'], '<!--content-table-->' ) !== false ){
     498            $use_template = false;
     499        }
     500
    495501        if ( $use_template ) {
    496502            // plain text or no content type
  • wp-html-mail/trunk/includes/class-haet-sender-plugin-fluent-crm.php

    r2973684 r3058117  
    77
    88    public function __construct( $mail ) {
    9         if ( ! array_key_exists( 'campaign', $_POST ) && ! array_key_exists( 'campaign_id', $_POST )) {
     9       
     10        if ( ! array_key_exists( 'campaign', $_POST ) && ! array_key_exists( 'campaign_id', $_POST ) && strpos( $mail['message'], 'fluentcrm' ) === false ) {
    1011            throw new Haet_Different_Plugin_Exception();
    1112        }
  • wp-html-mail/trunk/includes/class-haet-sender-plugin-fluent-support.php

    r2936317 r3058117  
    77
    88    public function __construct( $mail ) {
    9         if ( ! array_key_exists( 'client_priority', $_POST ) && ! array_key_exists( 'close_ticket', $_POST ) && ! array_key_exists( 'close_ticket_silently', $_POST ) && ! array_key_exists( 'ticket', $_POST )) {
     9        if ( ! array_key_exists( 'client_priority', $_POST ) && ! array_key_exists( 'close_ticket', $_POST ) && ! array_key_exists( 'close_ticket_silently', $_POST ) && ! array_key_exists( 'ticket', $_POST ) && ( strpos( $mail['message'], 'fs_comment' ) === false ) ) {
    1010            throw new Haet_Different_Plugin_Exception();
    1111        }
     
    2424
    2525}
     26
     27
  • wp-html-mail/trunk/includes/class-haet-sender-plugin.php

    r2973684 r3058117  
    309309            'easy-digital-downloads' => array(
    310310                'name'         => 'easy-digital-downloads',
    311                 'file'         => 'easy-digital-downloads/easy-digital-downloads.php',
     311                'files'         => ['easy-digital-downloads/easy-digital-downloads.php', 'easy-digital-downloads-pro/easy-digital-downloads.php'],
    312312                'class'        => 'Haet_Sender_Plugin_EDD',
    313313                'display_name' => 'Easy Digital Downloads',
  • wp-html-mail/trunk/readme.txt

    r2973684 r3058117  
    33Tags: email, email template, woocommerce email, email design, elementor, caldera-forms, easy-digital-downloads, contact-form-7, mandrill, postman, gravityforms
    44Requires at least: 5.4
    5 Tested up to: 6.3.1
     5Tested up to: 6.5
    66Requires PHP: 7.2
    7 Stable tag: 3.4.5
     7Stable tag: 3.4.7
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    175175== Changelog ==
    176176
     177= 3.4.7 =
     178* ADDED: Support for Fluent Support Mailbox mails
     179* FIXED: EDD Pro not recognized as active
     180* FIXED: display error when sending e-mails with FluentCRM automation
     181* updated dependencies to fix a notice in PHP 8.1
     182
    177183= 3.4.5 =
    178184* added support for The Newsletter Plugin
  • wp-html-mail/trunk/vendor/autoload.php

    r2259567 r3058117  
    33// autoload.php @generated by Composer
    44
     5if (PHP_VERSION_ID < 50600) {
     6    if (!headers_sent()) {
     7        header('HTTP/1.1 500 Internal Server Error');
     8    }
     9    $err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL;
     10    if (!ini_get('display_errors')) {
     11        if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
     12            fwrite(STDERR, $err);
     13        } elseif (!headers_sent()) {
     14            echo $err;
     15        }
     16    }
     17    trigger_error(
     18        $err,
     19        E_USER_ERROR
     20    );
     21}
     22
    523require_once __DIR__ . '/composer/autoload_real.php';
    624
  • wp-html-mail/trunk/vendor/composer/ClassLoader.php

    r2259567 r3058117  
    3838 * @author Fabien Potencier <[email protected]>
    3939 * @author Jordi Boggiano <[email protected]>
    40  * @see    http://www.php-fig.org/psr/psr-0/
    41  * @see    http://www.php-fig.org/psr/psr-4/
     40 * @see    https://www.php-fig.org/psr/psr-0/
     41 * @see    https://www.php-fig.org/psr/psr-4/
    4242 */
    4343class ClassLoader
    4444{
     45    /** @var \Closure(string):void */
     46    private static $includeFile;
     47
     48    /** @var ?string */
     49    private $vendorDir;
     50
    4551    // PSR-4
     52    /**
     53     * @var array[]
     54     * @psalm-var array<string, array<string, int>>
     55     */
    4656    private $prefixLengthsPsr4 = array();
     57    /**
     58     * @var array[]
     59     * @psalm-var array<string, array<int, string>>
     60     */
    4761    private $prefixDirsPsr4 = array();
     62    /**
     63     * @var array[]
     64     * @psalm-var array<string, string>
     65     */
    4866    private $fallbackDirsPsr4 = array();
    4967
    5068    // PSR-0
     69    /**
     70     * @var array[]
     71     * @psalm-var array<string, array<string, string[]>>
     72     */
    5173    private $prefixesPsr0 = array();
     74    /**
     75     * @var array[]
     76     * @psalm-var array<string, string>
     77     */
    5278    private $fallbackDirsPsr0 = array();
    5379
     80    /** @var bool */
    5481    private $useIncludePath = false;
     82
     83    /**
     84     * @var string[]
     85     * @psalm-var array<string, string>
     86     */
    5587    private $classMap = array();
     88
     89    /** @var bool */
    5690    private $classMapAuthoritative = false;
     91
     92    /**
     93     * @var bool[]
     94     * @psalm-var array<string, bool>
     95     */
    5796    private $missingClasses = array();
     97
     98    /** @var ?string */
    5899    private $apcuPrefix;
    59100
     101    /**
     102     * @var self[]
     103     */
     104    private static $registeredLoaders = array();
     105
     106    /**
     107     * @param ?string $vendorDir
     108     */
     109    public function __construct($vendorDir = null)
     110    {
     111        $this->vendorDir = $vendorDir;
     112        self::initializeIncludeClosure();
     113    }
     114
     115    /**
     116     * @return string[]
     117     */
    60118    public function getPrefixes()
    61119    {
    62120        if (!empty($this->prefixesPsr0)) {
    63             return call_user_func_array('array_merge', $this->prefixesPsr0);
     121            return call_user_func_array('array_merge', array_values($this->prefixesPsr0));
    64122        }
    65123
     
    67125    }
    68126
     127    /**
     128     * @return array[]
     129     * @psalm-return array<string, array<int, string>>
     130     */
    69131    public function getPrefixesPsr4()
    70132    {
     
    72134    }
    73135
     136    /**
     137     * @return array[]
     138     * @psalm-return array<string, string>
     139     */
    74140    public function getFallbackDirs()
    75141    {
     
    77143    }
    78144
     145    /**
     146     * @return array[]
     147     * @psalm-return array<string, string>
     148     */
    79149    public function getFallbackDirsPsr4()
    80150    {
     
    82152    }
    83153
     154    /**
     155     * @return string[] Array of classname => path
     156     * @psalm-return array<string, string>
     157     */
    84158    public function getClassMap()
    85159    {
     
    88162
    89163    /**
    90      * @param array $classMap Class to filename map
     164     * @param string[] $classMap Class to filename map
     165     * @psalm-param array<string, string> $classMap
     166     *
     167     * @return void
    91168     */
    92169    public function addClassMap(array $classMap)
     
    103180     * appending or prepending to the ones previously set for this prefix.
    104181     *
    105      * @param string       $prefix  The prefix
    106      * @param array|string $paths   The PSR-0 root directories
    107      * @param bool         $prepend Whether to prepend the directories
     182     * @param string          $prefix  The prefix
     183     * @param string[]|string $paths   The PSR-0 root directories
     184     * @param bool            $prepend Whether to prepend the directories
     185     *
     186     * @return void
    108187     */
    109188    public function add($prefix, $paths, $prepend = false)
     
    148227     * appending or prepending to the ones previously set for this namespace.
    149228     *
    150      * @param string       $prefix  The prefix/namespace, with trailing '\\'
    151      * @param array|string $paths   The PSR-4 base directories
    152      * @param bool         $prepend Whether to prepend the directories
     229     * @param string          $prefix  The prefix/namespace, with trailing '\\'
     230     * @param string[]|string $paths   The PSR-4 base directories
     231     * @param bool            $prepend Whether to prepend the directories
    153232     *
    154233     * @throws \InvalidArgumentException
     234     *
     235     * @return void
    155236     */
    156237    public function addPsr4($prefix, $paths, $prepend = false)
     
    196277     * replacing any others previously set for this prefix.
    197278     *
    198      * @param string       $prefix The prefix
    199      * @param array|string $paths  The PSR-0 base directories
     279     * @param string          $prefix The prefix
     280     * @param string[]|string $paths  The PSR-0 base directories
     281     *
     282     * @return void
    200283     */
    201284    public function set($prefix, $paths)
     
    212295     * replacing any others previously set for this namespace.
    213296     *
    214      * @param string       $prefix The prefix/namespace, with trailing '\\'
    215      * @param array|string $paths  The PSR-4 base directories
     297     * @param string          $prefix The prefix/namespace, with trailing '\\'
     298     * @param string[]|string $paths  The PSR-4 base directories
    216299     *
    217300     * @throws \InvalidArgumentException
     301     *
     302     * @return void
    218303     */
    219304    public function setPsr4($prefix, $paths)
     
    235320     *
    236321     * @param bool $useIncludePath
     322     *
     323     * @return void
    237324     */
    238325    public function setUseIncludePath($useIncludePath)
     
    257344     *
    258345     * @param bool $classMapAuthoritative
     346     *
     347     * @return void
    259348     */
    260349    public function setClassMapAuthoritative($classMapAuthoritative)
     
    277366     *
    278367     * @param string|null $apcuPrefix
     368     *
     369     * @return void
    279370     */
    280371    public function setApcuPrefix($apcuPrefix)
     
    297388     *
    298389     * @param bool $prepend Whether to prepend the autoloader or not
     390     *
     391     * @return void
    299392     */
    300393    public function register($prepend = false)
    301394    {
    302395        spl_autoload_register(array($this, 'loadClass'), true, $prepend);
     396
     397        if (null === $this->vendorDir) {
     398            return;
     399        }
     400
     401        if ($prepend) {
     402            self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders;
     403        } else {
     404            unset(self::$registeredLoaders[$this->vendorDir]);
     405            self::$registeredLoaders[$this->vendorDir] = $this;
     406        }
    303407    }
    304408
    305409    /**
    306410     * Unregisters this instance as an autoloader.
     411     *
     412     * @return void
    307413     */
    308414    public function unregister()
    309415    {
    310416        spl_autoload_unregister(array($this, 'loadClass'));
     417
     418        if (null !== $this->vendorDir) {
     419            unset(self::$registeredLoaders[$this->vendorDir]);
     420        }
    311421    }
    312422
     
    315425     *
    316426     * @param  string    $class The name of the class
    317      * @return bool|null True if loaded, null otherwise
     427     * @return true|null True if loaded, null otherwise
    318428     */
    319429    public function loadClass($class)
    320430    {
    321431        if ($file = $this->findFile($class)) {
    322             includeFile($file);
     432            $includeFile = self::$includeFile;
     433            $includeFile($file);
    323434
    324435            return true;
    325436        }
     437
     438        return null;
    326439    }
    327440
     
    368481    }
    369482
     483    /**
     484     * Returns the currently registered loaders indexed by their corresponding vendor directories.
     485     *
     486     * @return self[]
     487     */
     488    public static function getRegisteredLoaders()
     489    {
     490        return self::$registeredLoaders;
     491    }
     492
     493    /**
     494     * @param  string       $class
     495     * @param  string       $ext
     496     * @return string|false
     497     */
    370498    private function findFileWithExtension($class, $ext)
    371499    {
     
    433561        return false;
    434562    }
     563
     564    /**
     565     * @return void
     566     */
     567    private static function initializeIncludeClosure()
     568    {
     569        if (self::$includeFile !== null) {
     570            return;
     571        }
     572
     573        /**
     574         * Scope isolated include.
     575         *
     576         * Prevents access to $this/self from included files.
     577         *
     578         * @param  string $file
     579         * @return void
     580         */
     581        self::$includeFile = \Closure::bind(static function($file) {
     582            include $file;
     583        }, null, null);
     584    }
    435585}
    436 
    437 /**
    438  * Scope isolated include.
    439  *
    440  * Prevents access to $this/self from included files.
    441  */
    442 function includeFile($file)
    443 {
    444     include $file;
    445 }
  • wp-html-mail/trunk/vendor/composer/autoload_classmap.php

    r2259567 r3058117  
    33// autoload_classmap.php @generated by Composer
    44
    5 $vendorDir = dirname(dirname(__FILE__));
     5$vendorDir = dirname(__DIR__);
    66$baseDir = dirname($vendorDir);
    77
    88return array(
     9    'Attribute' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Attribute.php',
     10    'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
     11    'PhpToken' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php',
     12    'Stringable' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Stringable.php',
     13    'UnhandledMatchError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php',
     14    'ValueError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/ValueError.php',
    915);
  • wp-html-mail/trunk/vendor/composer/autoload_namespaces.php

    r2259567 r3058117  
    33// autoload_namespaces.php @generated by Composer
    44
    5 $vendorDir = dirname(dirname(__FILE__));
     5$vendorDir = dirname(__DIR__);
    66$baseDir = dirname($vendorDir);
    77
    88return array(
    9     'Sabberworm\\CSS' => array($vendorDir . '/sabberworm/php-css-parser/lib'),
    109);
  • wp-html-mail/trunk/vendor/composer/autoload_psr4.php

    r2560935 r3058117  
    33// autoload_psr4.php @generated by Composer
    44
    5 $vendorDir = dirname(dirname(__FILE__));
     5$vendorDir = dirname(__DIR__);
    66$baseDir = dirname($vendorDir);
    77
     
    99    'voku\\helper\\' => array($vendorDir . '/voku/simple_html_dom/src/voku/helper'),
    1010    'voku\\CssToInlineStyles\\' => array($vendorDir . '/voku/css-to-inline-styles/src'),
     11    'Symfony\\Polyfill\\Php80\\' => array($vendorDir . '/symfony/polyfill-php80'),
    1112    'Symfony\\Component\\CssSelector\\' => array($vendorDir . '/symfony/css-selector'),
    12     'Barryvdh\\Composer\\' => array($vendorDir . '/barryvdh/composer-cleanup-plugin/src'),
     13    'Sabberworm\\CSS\\' => array($vendorDir . '/sabberworm/php-css-parser/src'),
    1314);
  • wp-html-mail/trunk/vendor/composer/autoload_real.php

    r2259567 r3058117  
    1414    }
    1515
     16    /**
     17     * @return \Composer\Autoload\ClassLoader
     18     */
    1619    public static function getLoader()
    1720    {
     
    2023        }
    2124
     25        require __DIR__ . '/platform_check.php';
     26
    2227        spl_autoload_register(array('ComposerAutoloaderInit9ed2230ac70257f403e8e80f0f3a3d71', 'loadClassLoader'), true, true);
    23         self::$loader = $loader = new \Composer\Autoload\ClassLoader();
     28        self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
    2429        spl_autoload_unregister(array('ComposerAutoloaderInit9ed2230ac70257f403e8e80f0f3a3d71', 'loadClassLoader'));
    2530
    26         $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
    27         if ($useStaticLoader) {
    28             require_once __DIR__ . '/autoload_static.php';
    29 
    30             call_user_func(\Composer\Autoload\ComposerStaticInit9ed2230ac70257f403e8e80f0f3a3d71::getInitializer($loader));
    31         } else {
    32             $map = require __DIR__ . '/autoload_namespaces.php';
    33             foreach ($map as $namespace => $path) {
    34                 $loader->set($namespace, $path);
    35             }
    36 
    37             $map = require __DIR__ . '/autoload_psr4.php';
    38             foreach ($map as $namespace => $path) {
    39                 $loader->setPsr4($namespace, $path);
    40             }
    41 
    42             $classMap = require __DIR__ . '/autoload_classmap.php';
    43             if ($classMap) {
    44                 $loader->addClassMap($classMap);
    45             }
    46         }
     31        require __DIR__ . '/autoload_static.php';
     32        call_user_func(\Composer\Autoload\ComposerStaticInit9ed2230ac70257f403e8e80f0f3a3d71::getInitializer($loader));
    4733
    4834        $loader->register(true);
     35
     36        $filesToLoad = \Composer\Autoload\ComposerStaticInit9ed2230ac70257f403e8e80f0f3a3d71::$files;
     37        $requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
     38            if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
     39                $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
     40
     41                require $file;
     42            }
     43        }, null, null);
     44        foreach ($filesToLoad as $fileIdentifier => $file) {
     45            $requireFile($fileIdentifier, $file);
     46        }
    4947
    5048        return $loader;
  • wp-html-mail/trunk/vendor/composer/autoload_static.php

    r2560935 r3058117  
    77class ComposerStaticInit9ed2230ac70257f403e8e80f0f3a3d71
    88{
     9    public static $files = array (
     10        'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php',
     11    );
     12
    913    public static $prefixLengthsPsr4 = array (
    1014        'v' =>
     
    1519        'S' =>
    1620        array (
     21            'Symfony\\Polyfill\\Php80\\' => 23,
    1722            'Symfony\\Component\\CssSelector\\' => 30,
    18         ),
    19         'B' =>
    20         array (
    21             'Barryvdh\\Composer\\' => 18,
     23            'Sabberworm\\CSS\\' => 15,
    2224        ),
    2325    );
     
    3234            0 => __DIR__ . '/..' . '/voku/css-to-inline-styles/src',
    3335        ),
     36        'Symfony\\Polyfill\\Php80\\' =>
     37        array (
     38            0 => __DIR__ . '/..' . '/symfony/polyfill-php80',
     39        ),
    3440        'Symfony\\Component\\CssSelector\\' =>
    3541        array (
    3642            0 => __DIR__ . '/..' . '/symfony/css-selector',
    3743        ),
    38         'Barryvdh\\Composer\\' =>
     44        'Sabberworm\\CSS\\' =>
    3945        array (
    40             0 => __DIR__ . '/..' . '/barryvdh/composer-cleanup-plugin/src',
     46            0 => __DIR__ . '/..' . '/sabberworm/php-css-parser/src',
    4147        ),
    4248    );
    4349
    44     public static $prefixesPsr0 = array (
    45         'S' =>
    46         array (
    47             'Sabberworm\\CSS' =>
    48             array (
    49                 0 => __DIR__ . '/..' . '/sabberworm/php-css-parser/lib',
    50             ),
    51         ),
     50    public static $classMap = array (
     51        'Attribute' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Attribute.php',
     52        'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
     53        'PhpToken' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php',
     54        'Stringable' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Stringable.php',
     55        'UnhandledMatchError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php',
     56        'ValueError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/ValueError.php',
    5257    );
    5358
     
    5762            $loader->prefixLengthsPsr4 = ComposerStaticInit9ed2230ac70257f403e8e80f0f3a3d71::$prefixLengthsPsr4;
    5863            $loader->prefixDirsPsr4 = ComposerStaticInit9ed2230ac70257f403e8e80f0f3a3d71::$prefixDirsPsr4;
    59             $loader->prefixesPsr0 = ComposerStaticInit9ed2230ac70257f403e8e80f0f3a3d71::$prefixesPsr0;
     64            $loader->classMap = ComposerStaticInit9ed2230ac70257f403e8e80f0f3a3d71::$classMap;
    6065
    6166        }, null, ClassLoader::class);
  • wp-html-mail/trunk/vendor/composer/installed.json

    r2800468 r3058117  
    1 [
    2     {
    3         "name": "barryvdh/composer-cleanup-plugin",
    4         "version": "v0.2.0",
    5         "version_normalized": "0.2.0.0",
    6         "source": {
    7             "type": "git",
    8             "url": "https://github.com/barryvdh/composer-cleanup-plugin.git",
    9             "reference": "1efa5ce0aa415f1e7bc7fccfbedfe43d8f0941b0"
     1{
     2    "packages": [
     3        {
     4            "name": "sabberworm/php-css-parser",
     5            "version": "8.4.0",
     6            "version_normalized": "8.4.0.0",
     7            "source": {
     8                "type": "git",
     9                "url": "https://github.com/sabberworm/PHP-CSS-Parser.git",
     10                "reference": "e41d2140031d533348b2192a83f02d8dd8a71d30"
     11            },
     12            "dist": {
     13                "type": "zip",
     14                "url": "https://api.github.com/repos/sabberworm/PHP-CSS-Parser/zipball/e41d2140031d533348b2192a83f02d8dd8a71d30",
     15                "reference": "e41d2140031d533348b2192a83f02d8dd8a71d30",
     16                "shasum": ""
     17            },
     18            "require": {
     19                "ext-iconv": "*",
     20                "php": ">=5.6.20"
     21            },
     22            "require-dev": {
     23                "codacy/coverage": "^1.4",
     24                "phpunit/phpunit": "^4.8.36"
     25            },
     26            "suggest": {
     27                "ext-mbstring": "for parsing UTF-8 CSS"
     28            },
     29            "time": "2021-12-11T13:40:54+00:00",
     30            "type": "library",
     31            "installation-source": "dist",
     32            "autoload": {
     33                "psr-4": {
     34                    "Sabberworm\\CSS\\": "src/"
     35                }
     36            },
     37            "notification-url": "https://packagist.org/downloads/",
     38            "license": [
     39                "MIT"
     40            ],
     41            "authors": [
     42                {
     43                    "name": "Raphael Schweikert"
     44                }
     45            ],
     46            "description": "Parser for CSS Files written in PHP",
     47            "homepage": "https://www.sabberworm.com/blog/2010/6/10/php-css-parser",
     48            "keywords": [
     49                "css",
     50                "parser",
     51                "stylesheet"
     52            ],
     53            "support": {
     54                "issues": "https://github.com/sabberworm/PHP-CSS-Parser/issues",
     55                "source": "https://github.com/sabberworm/PHP-CSS-Parser/tree/8.4.0"
     56            },
     57            "install-path": "../sabberworm/php-css-parser"
    1058        },
    11         "dist": {
    12             "type": "zip",
    13             "url": "https://api.github.com/repos/barryvdh/composer-cleanup-plugin/zipball/1efa5ce0aa415f1e7bc7fccfbedfe43d8f0941b0",
    14             "reference": "1efa5ce0aa415f1e7bc7fccfbedfe43d8f0941b0",
    15             "shasum": ""
     59        {
     60            "name": "symfony/css-selector",
     61            "version": "v5.4.26",
     62            "version_normalized": "5.4.26.0",
     63            "source": {
     64                "type": "git",
     65                "url": "https://github.com/symfony/css-selector.git",
     66                "reference": "0ad3f7e9a1ab492c5b4214cf22a9dc55dcf8600a"
     67            },
     68            "dist": {
     69                "type": "zip",
     70                "url": "https://api.github.com/repos/symfony/css-selector/zipball/0ad3f7e9a1ab492c5b4214cf22a9dc55dcf8600a",
     71                "reference": "0ad3f7e9a1ab492c5b4214cf22a9dc55dcf8600a",
     72                "shasum": ""
     73            },
     74            "require": {
     75                "php": ">=7.2.5",
     76                "symfony/polyfill-php80": "^1.16"
     77            },
     78            "time": "2023-07-07T06:10:25+00:00",
     79            "type": "library",
     80            "installation-source": "dist",
     81            "autoload": {
     82                "psr-4": {
     83                    "Symfony\\Component\\CssSelector\\": ""
     84                },
     85                "exclude-from-classmap": [
     86                    "/Tests/"
     87                ]
     88            },
     89            "notification-url": "https://packagist.org/downloads/",
     90            "license": [
     91                "MIT"
     92            ],
     93            "authors": [
     94                {
     95                    "name": "Fabien Potencier",
     96                    "email": "[email protected]"
     97                },
     98                {
     99                    "name": "Jean-François Simon",
     100                    "email": "[email protected]"
     101                },
     102                {
     103                    "name": "Symfony Community",
     104                    "homepage": "https://symfony.com/contributors"
     105                }
     106            ],
     107            "description": "Converts CSS selectors to XPath expressions",
     108            "homepage": "https://symfony.com",
     109            "support": {
     110                "source": "https://github.com/symfony/css-selector/tree/v5.4.26"
     111            },
     112            "funding": [
     113                {
     114                    "url": "https://symfony.com/sponsor",
     115                    "type": "custom"
     116                },
     117                {
     118                    "url": "https://github.com/fabpot",
     119                    "type": "github"
     120                },
     121                {
     122                    "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
     123                    "type": "tidelift"
     124                }
     125            ],
     126            "install-path": "../symfony/css-selector"
    16127        },
    17         "require": {
    18             "composer-plugin-api": "^1.0"
     128        {
     129            "name": "symfony/polyfill-php80",
     130            "version": "v1.28.0",
     131            "version_normalized": "1.28.0.0",
     132            "source": {
     133                "type": "git",
     134                "url": "https://github.com/symfony/polyfill-php80.git",
     135                "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5"
     136            },
     137            "dist": {
     138                "type": "zip",
     139                "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/6caa57379c4aec19c0a12a38b59b26487dcfe4b5",
     140                "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5",
     141                "shasum": ""
     142            },
     143            "require": {
     144                "php": ">=7.1"
     145            },
     146            "time": "2023-01-26T09:26:14+00:00",
     147            "type": "library",
     148            "extra": {
     149                "branch-alias": {
     150                    "dev-main": "1.28-dev"
     151                },
     152                "thanks": {
     153                    "name": "symfony/polyfill",
     154                    "url": "https://github.com/symfony/polyfill"
     155                }
     156            },
     157            "installation-source": "dist",
     158            "autoload": {
     159                "files": [
     160                    "bootstrap.php"
     161                ],
     162                "psr-4": {
     163                    "Symfony\\Polyfill\\Php80\\": ""
     164                },
     165                "classmap": [
     166                    "Resources/stubs"
     167                ]
     168            },
     169            "notification-url": "https://packagist.org/downloads/",
     170            "license": [
     171                "MIT"
     172            ],
     173            "authors": [
     174                {
     175                    "name": "Ion Bazan",
     176                    "email": "[email protected]"
     177                },
     178                {
     179                    "name": "Nicolas Grekas",
     180                    "email": "[email protected]"
     181                },
     182                {
     183                    "name": "Symfony Community",
     184                    "homepage": "https://symfony.com/contributors"
     185                }
     186            ],
     187            "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions",
     188            "homepage": "https://symfony.com",
     189            "keywords": [
     190                "compatibility",
     191                "polyfill",
     192                "portable",
     193                "shim"
     194            ],
     195            "support": {
     196                "source": "https://github.com/symfony/polyfill-php80/tree/v1.28.0"
     197            },
     198            "funding": [
     199                {
     200                    "url": "https://symfony.com/sponsor",
     201                    "type": "custom"
     202                },
     203                {
     204                    "url": "https://github.com/fabpot",
     205                    "type": "github"
     206                },
     207                {
     208                    "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
     209                    "type": "tidelift"
     210                }
     211            ],
     212            "install-path": "../symfony/polyfill-php80"
    19213        },
    20         "time": "2018-05-14T08:32:22+00:00",
    21         "type": "composer-plugin",
    22         "extra": {
    23             "branch-alias": {
    24                 "dev-master": "0.1-dev"
    25             },
    26             "class": "Barryvdh\\Composer\\CleanupPlugin"
     214        {
     215            "name": "voku/css-to-inline-styles",
     216            "version": "2.0.3",
     217            "version_normalized": "2.0.3.0",
     218            "source": {
     219                "type": "git",
     220                "url": "https://github.com/voku/CssToInlineStyles.git",
     221                "reference": "64e16278545d5ce1b6197136b3fbbaf90f1f2670"
     222            },
     223            "dist": {
     224                "type": "zip",
     225                "url": "https://api.github.com/repos/voku/CssToInlineStyles/zipball/64e16278545d5ce1b6197136b3fbbaf90f1f2670",
     226                "reference": "64e16278545d5ce1b6197136b3fbbaf90f1f2670",
     227                "shasum": ""
     228            },
     229            "require": {
     230                "ext-dom": "*",
     231                "php": ">=7.0.0",
     232                "symfony/css-selector": "~3.0 || ~4.0 || ~5.0",
     233                "voku/simple_html_dom": "~4.7"
     234            },
     235            "require-dev": {
     236                "phpunit/phpunit": "~6.0 || ~7.0"
     237            },
     238            "time": "2020-02-23T12:51:47+00:00",
     239            "type": "library",
     240            "extra": {
     241                "branch-alias": {
     242                    "dev-master": "1.6.x-dev"
     243                }
     244            },
     245            "installation-source": "dist",
     246            "autoload": {
     247                "psr-4": {
     248                    "voku\\CssToInlineStyles\\": "src"
     249                }
     250            },
     251            "notification-url": "https://packagist.org/downloads/",
     252            "license": [
     253                "BSD-3-Clause"
     254            ],
     255            "authors": [
     256                {
     257                    "name": "Tijs Verkoyen",
     258                    "email": "[email protected]",
     259                    "role": "Developer"
     260                },
     261                {
     262                    "name": "Lars Moelleken",
     263                    "email": "[email protected]",
     264                    "homepage": "https://github.com/voku",
     265                    "role": "Developer"
     266                }
     267            ],
     268            "description": "Only a Fork of -> CssToInlineStyles is a class that enables you to convert HTML-pages/files into HTML-pages/files with inline styles. This is very useful when you're sending emails.",
     269            "homepage": "https://github.com/voku/CssToInlineStyles",
     270            "keywords": [
     271                "CSSToHtml",
     272                "CSSinline",
     273                "css",
     274                "css-to-html",
     275                "email",
     276                "inline",
     277                "style"
     278            ],
     279            "install-path": "../voku/css-to-inline-styles"
    27280        },
    28         "installation-source": "dist",
    29         "autoload": {
    30             "psr-4": {
    31                 "Barryvdh\\Composer\\": "src/"
    32             }
    33         },
    34         "notification-url": "https://packagist.org/downloads/",
    35         "license": [
    36             "MIT"
    37         ],
    38         "authors": [
    39             {
    40                 "name": "Barry vd. Heuvel",
    41                 "email": "[email protected]"
    42             }
    43         ],
    44         "description": "A composer cleanup plugin, to remove tests and documentation to save space"
    45     },
    46     {
    47         "name": "sabberworm/php-css-parser",
    48         "version": "8.3.1",
    49         "version_normalized": "8.3.1.0",
    50         "source": {
    51             "type": "git",
    52             "url": "https://github.com/sabberworm/PHP-CSS-Parser.git",
    53             "reference": "d217848e1396ef962fb1997cf3e2421acba7f796"
    54         },
    55         "dist": {
    56             "type": "zip",
    57             "url": "https://api.github.com/repos/sabberworm/PHP-CSS-Parser/zipball/d217848e1396ef962fb1997cf3e2421acba7f796",
    58             "reference": "d217848e1396ef962fb1997cf3e2421acba7f796",
    59             "shasum": ""
    60         },
    61         "require": {
    62             "php": ">=5.3.2"
    63         },
    64         "require-dev": {
    65             "codacy/coverage": "^1.4",
    66             "phpunit/phpunit": "~4.8"
    67         },
    68         "time": "2020-06-01T09:10:00+00:00",
    69         "type": "library",
    70         "installation-source": "dist",
    71         "autoload": {
    72             "psr-0": {
    73                 "Sabberworm\\CSS": "lib/"
    74             }
    75         },
    76         "notification-url": "https://packagist.org/downloads/",
    77         "license": [
    78             "MIT"
    79         ],
    80         "authors": [
    81             {
    82                 "name": "Raphael Schweikert"
    83             }
    84         ],
    85         "description": "Parser for CSS Files written in PHP",
    86         "homepage": "http://www.sabberworm.com/blog/2010/6/10/php-css-parser",
    87         "keywords": [
    88             "css",
    89             "parser",
    90             "stylesheet"
    91         ]
    92     },
    93     {
    94         "name": "symfony/css-selector",
    95         "version": "v5.3.0",
    96         "version_normalized": "5.3.0.0",
    97         "source": {
    98             "type": "git",
    99             "url": "https://github.com/symfony/css-selector.git",
    100             "reference": "fcd0b29a7a0b1bb5bfbedc6231583d77fea04814"
    101         },
    102         "dist": {
    103             "type": "zip",
    104             "url": "https://api.github.com/repos/symfony/css-selector/zipball/fcd0b29a7a0b1bb5bfbedc6231583d77fea04814",
    105             "reference": "fcd0b29a7a0b1bb5bfbedc6231583d77fea04814",
    106             "shasum": ""
    107         },
    108         "require": {
    109             "php": ">=7.2.5"
    110         },
    111         "time": "2021-05-26T17:40:38+00:00",
    112         "type": "library",
    113         "installation-source": "dist",
    114         "autoload": {
    115             "psr-4": {
    116                 "Symfony\\Component\\CssSelector\\": ""
    117             },
    118             "exclude-from-classmap": [
    119                 "/Tests/"
    120             ]
    121         },
    122         "notification-url": "https://packagist.org/downloads/",
    123         "license": [
    124             "MIT"
    125         ],
    126         "authors": [
    127             {
    128                 "name": "Fabien Potencier",
    129                 "email": "[email protected]"
    130             },
    131             {
    132                 "name": "Jean-François Simon",
    133                 "email": "[email protected]"
    134             },
    135             {
    136                 "name": "Symfony Community",
    137                 "homepage": "https://symfony.com/contributors"
    138             }
    139         ],
    140         "description": "Converts CSS selectors to XPath expressions",
    141         "homepage": "https://symfony.com"
    142     },
    143     {
    144         "name": "voku/css-to-inline-styles",
    145         "version": "2.0.3",
    146         "version_normalized": "2.0.3.0",
    147         "source": {
    148             "type": "git",
    149             "url": "https://github.com/voku/CssToInlineStyles.git",
    150             "reference": "64e16278545d5ce1b6197136b3fbbaf90f1f2670"
    151         },
    152         "dist": {
    153             "type": "zip",
    154             "url": "https://api.github.com/repos/voku/CssToInlineStyles/zipball/64e16278545d5ce1b6197136b3fbbaf90f1f2670",
    155             "reference": "64e16278545d5ce1b6197136b3fbbaf90f1f2670",
    156             "shasum": ""
    157         },
    158         "require": {
    159             "ext-dom": "*",
    160             "php": ">=7.0.0",
    161             "symfony/css-selector": "~3.0 || ~4.0 || ~5.0",
    162             "voku/simple_html_dom": "~4.7"
    163         },
    164         "require-dev": {
    165             "phpunit/phpunit": "~6.0 || ~7.0"
    166         },
    167         "time": "2020-02-23T12:51:47+00:00",
    168         "type": "library",
    169         "extra": {
    170             "branch-alias": {
    171                 "dev-master": "1.6.x-dev"
    172             }
    173         },
    174         "installation-source": "dist",
    175         "autoload": {
    176             "psr-4": {
    177                 "voku\\CssToInlineStyles\\": "src"
    178             }
    179         },
    180         "notification-url": "https://packagist.org/downloads/",
    181         "license": [
    182             "BSD-3-Clause"
    183         ],
    184         "authors": [
    185             {
    186                 "name": "Tijs Verkoyen",
    187                 "email": "[email protected]",
    188                 "role": "Developer"
    189             },
    190             {
    191                 "name": "Lars Moelleken",
    192                 "email": "[email protected]",
    193                 "homepage": "https://github.com/voku",
    194                 "role": "Developer"
    195             }
    196         ],
    197         "description": "Only a Fork of -> CssToInlineStyles is a class that enables you to convert HTML-pages/files into HTML-pages/files with inline styles. This is very useful when you're sending emails.",
    198         "homepage": "https://github.com/voku/CssToInlineStyles",
    199         "keywords": [
    200             "CSSToHtml",
    201             "CSSinline",
    202             "css",
    203             "css-to-html",
    204             "email",
    205             "inline",
    206             "style"
    207         ]
    208     },
    209     {
    210         "name": "voku/simple_html_dom",
    211         "version": "4.7.29",
    212         "version_normalized": "4.7.29.0",
    213         "source": {
    214             "type": "git",
    215             "url": "https://github.com/voku/simple_html_dom.git",
    216             "reference": "079067c704b714b7c2813971297bb340307813e7"
    217         },
    218         "dist": {
    219             "type": "zip",
    220             "url": "https://api.github.com/repos/voku/simple_html_dom/zipball/079067c704b714b7c2813971297bb340307813e7",
    221             "reference": "079067c704b714b7c2813971297bb340307813e7",
    222             "shasum": ""
    223         },
    224         "require": {
    225             "ext-dom": "*",
    226             "ext-libxml": "*",
    227             "ext-simplexml": "*",
    228             "php": ">=7.0.0",
    229             "symfony/css-selector": "~3.0 || ~4.0 || ~5.0"
    230         },
    231         "require-dev": {
    232             "phpunit/phpunit": "~6.0 || ~7.0 || ~9.0"
    233         },
    234         "suggest": {
    235             "voku/portable-utf8": "If you need e.g. UTF-8 fixed output."
    236         },
    237         "time": "2021-03-29T14:56:56+00:00",
    238         "type": "library",
    239         "installation-source": "dist",
    240         "autoload": {
    241             "psr-4": {
    242                 "voku\\helper\\": "src/voku/helper/"
    243             }
    244         },
    245         "notification-url": "https://packagist.org/downloads/",
    246         "license": [
    247             "MIT"
    248         ],
    249         "authors": [
    250             {
    251                 "name": "dimabdc",
    252                 "email": "[email protected]",
    253                 "homepage": "http://github.com/dimabdc",
    254                 "role": "Developer"
    255             },
    256             {
    257                 "name": "Lars Moelleken",
    258                 "homepage": "http://www.moelleken.org/",
    259                 "role": "Developer"
    260             }
    261         ],
    262         "description": "Simple HTML DOM package.",
    263         "homepage": "http://simplehtmldom.sourceforge.net/",
    264         "keywords": [
    265             "HTML Parser",
    266             "dom",
    267             "php dom"
    268         ]
    269     }
    270 ]
     281        {
     282            "name": "voku/simple_html_dom",
     283            "version": "4.8.8",
     284            "version_normalized": "4.8.8.0",
     285            "source": {
     286                "type": "git",
     287                "url": "https://github.com/voku/simple_html_dom.git",
     288                "reference": "9ef90f0280fe16054c117e04ea86617ce0fcdd35"
     289            },
     290            "dist": {
     291                "type": "zip",
     292                "url": "https://api.github.com/repos/voku/simple_html_dom/zipball/9ef90f0280fe16054c117e04ea86617ce0fcdd35",
     293                "reference": "9ef90f0280fe16054c117e04ea86617ce0fcdd35",
     294                "shasum": ""
     295            },
     296            "require": {
     297                "ext-dom": "*",
     298                "ext-libxml": "*",
     299                "ext-simplexml": "*",
     300                "php": ">=7.0.0",
     301                "symfony/css-selector": "~3.0 || ~4.0 || ~5.0 || ~6.0"
     302            },
     303            "require-dev": {
     304                "phpunit/phpunit": "~6.0 || ~7.0 || ~9.0"
     305            },
     306            "suggest": {
     307                "voku/portable-utf8": "If you need e.g. UTF-8 fixed output."
     308            },
     309            "time": "2023-02-12T16:15:15+00:00",
     310            "type": "library",
     311            "installation-source": "dist",
     312            "autoload": {
     313                "psr-4": {
     314                    "voku\\helper\\": "src/voku/helper/"
     315                }
     316            },
     317            "notification-url": "https://packagist.org/downloads/",
     318            "license": [
     319                "MIT"
     320            ],
     321            "authors": [
     322                {
     323                    "name": "dimabdc",
     324                    "email": "[email protected]",
     325                    "homepage": "https://github.com/dimabdc",
     326                    "role": "Developer"
     327                },
     328                {
     329                    "name": "Lars Moelleken",
     330                    "homepage": "https://www.moelleken.org/",
     331                    "role": "Fork-Maintainer"
     332                }
     333            ],
     334            "description": "Simple HTML DOM package.",
     335            "homepage": "https://github.com/voku/simple_html_dom",
     336            "keywords": [
     337                "HTML Parser",
     338                "dom",
     339                "php dom"
     340            ],
     341            "support": {
     342                "issues": "https://github.com/voku/simple_html_dom/issues",
     343                "source": "https://github.com/voku/simple_html_dom/tree/4.8.8"
     344            },
     345            "funding": [
     346                {
     347                    "url": "https://www.paypal.me/moelleken",
     348                    "type": "custom"
     349                },
     350                {
     351                    "url": "https://github.com/voku",
     352                    "type": "github"
     353                },
     354                {
     355                    "url": "https://www.patreon.com/voku",
     356                    "type": "patreon"
     357                },
     358                {
     359                    "url": "https://tidelift.com/funding/github/packagist/voku/simple_html_dom",
     360                    "type": "tidelift"
     361                }
     362            ],
     363            "install-path": "../voku/simple_html_dom"
     364        }
     365    ],
     366    "dev": true,
     367    "dev-package-names": []
     368}
  • wp-html-mail/trunk/vendor/sabberworm/php-css-parser/CHANGELOG.md

    r2259567 r3058117  
    11# Revision History
    22
    3 ## 8.0
    4 
    5 ### 8.0.0 (2016-06-30)
    6 
    7 * Store source CSS line numbers in tokens and parsing exceptions.
    8 * *No deprecations*
    9 
    10 #### Backwards-incompatible changes
    11 
    12 * Unrecoverable parser errors throw an exception of type `Sabberworm\CSS\Parsing\SourceException` instead of `\Exception`.
    13 
    14 ### 8.1.0 (2016-07-19)
    15 
    16 * Comments are no longer silently ignored but stored with the object with which they appear (no render support, though). Thanks to @FMCorz.
    17 * The IE hacks using `\0` and `\9` can now be parsed (and rendered) in lenient mode. Thanks (again) to @FMCorz.
    18 * Media queries with or without spaces before the query are parsed. Still no *real* parsing support, though. Sorry…
    19 * PHPUnit is now listed as a dev-dependency in composer.json.
    20 * *No backwards-incompatible changes*
    21 * *No deprecations*
    22 
    23 ### 8.2.0 (2018-07-13)
    24 
    25 * Support parsing `calc()`, thanks to @raxbg.
    26 * Support parsing grid-lines, again thanks to @raxbg.
    27 * Support parsing legacy IE filters (`progid:`) in lenient mode, thanks to @FMCorz
    28 * Performance improvements parsing large files, again thanks to @FMCorz
    29 * *No backwards-incompatible changes*
    30 * *No deprecations*
    31 
    32 ### 8.3.0 (2019-02-22)
     3## 8.4.0
     4
     5### Features
     6
     7* Support for PHP 8.x
     8* PHPDoc annotations
     9* Allow usage of CSS variables inside color functions (by parsing them as regular functions)
     10* Use PSR-12 code style
     11* *No deprecations*
     12
     13### Bugfixes
     14
     15* Improved handling of whitespace in `calc()`
     16* Fix parsing units whose prefix is also a valid unit, like `vmin`
     17* Allow passing an object to `CSSList#replace`
     18* Fix PHP 7.3 warnings
     19* Correctly parse keyframes with `%`
     20* Don’t convert large numbers to scientific notation
     21* Allow a file to end after an `@import`
     22* Preserve case of CSS variables as specced
     23* Allow identifiers to use escapes the same way as strings
     24* No longer use `eval` for the comparison in `getSelectorsBySpecificity`, in case it gets passed untrusted input (CVE-2020-13756). Also fixed in 8.3.1, 8.2.1, 8.1.1, 8.0.1, 7.0.4, 6.0.2, 5.2.1, 5.1.3, 5.0.9, 4.0.1, 3.0.1, 2.0.1, 1.0.1.
     25* Prevent an infinite loop when parsing invalid grid line names
     26* Remove invalid unit `vm`
     27* Retain rule order after expanding shorthands
     28
     29### Backwards-incompatible changes
     30
     31* PHP ≥ 5.6 is now required
     32* HHVM compatibility target dropped
     33
     34## 8.3.0 (2019-02-22)
    3335
    3436* Refactor parsing logic to mostly reside in the class files whose data structure is to be parsed (this should eventually allow us to unit-test specific parts of the parsing logic individually).
     
    4042* *No deprecations*
    4143
    42 ## 7.0
    43 
    44 ### 7.0.0 (2015-08-24)
     44## 8.2.0 (2018-07-13)
     45
     46* Support parsing `calc()`, thanks to @raxbg.
     47* Support parsing grid-lines, again thanks to @raxbg.
     48* Support parsing legacy IE filters (`progid:`) in lenient mode, thanks to @FMCorz
     49* Performance improvements parsing large files, again thanks to @FMCorz
     50* *No backwards-incompatible changes*
     51* *No deprecations*
     52
     53## 8.1.0 (2016-07-19)
     54
     55* Comments are no longer silently ignored but stored with the object with which they appear (no render support, though). Thanks to @FMCorz.
     56* The IE hacks using `\0` and `\9` can now be parsed (and rendered) in lenient mode. Thanks (again) to @FMCorz.
     57* Media queries with or without spaces before the query are parsed. Still no *real* parsing support, though. Sorry…
     58* PHPUnit is now listed as a dev-dependency in composer.json.
     59* *No backwards-incompatible changes*
     60* *No deprecations*
     61
     62## 8.0.0 (2016-06-30)
     63
     64* Store source CSS line numbers in tokens and parsing exceptions.
     65* *No deprecations*
     66
     67### Backwards-incompatible changes
     68
     69* Unrecoverable parser errors throw an exception of type `Sabberworm\CSS\Parsing\SourceException` instead of `\Exception`.
     70
     71## 7.0.3 (2016-04-27)
     72
     73* Fixed parsing empty CSS when multibyte is off
     74* *No backwards-incompatible changes*
     75* *No deprecations*
     76
     77## 7.0.2 (2016-02-11)
     78
     79* 150 time performance boost thanks to @[ossinkine](https://github.com/ossinkine)
     80* *No backwards-incompatible changes*
     81* *No deprecations*
     82
     83## 7.0.1 (2015-12-25)
     84
     85* No more suppressed `E_NOTICE`
     86* *No backwards-incompatible changes*
     87* *No deprecations*
     88
     89## 7.0.0 (2015-08-24)
    4590
    4691* Compatibility with PHP 7. Well timed, eh?
    4792* *No deprecations*
    4893
     94### Backwards-incompatible changes
     95
     96* The `Sabberworm\CSS\Value\String` class has been renamed to `Sabberworm\CSS\Value\CSSString`.
     97
     98## 6.0.1 (2015-08-24)
     99
     100* Remove some declarations in interfaces incompatible with PHP 5.3 (< 5.3.9)
     101* *No deprecations*
     102
     103## 6.0.0 (2014-07-03)
     104
     105* Format output using Sabberworm\CSS\OutputFormat
     106* *No backwards-incompatible changes*
     107
     108### Deprecations
     109
     110* The parse() method replaces __toString with an optional argument (instance of the OutputFormat class)
     111
     112## 5.2.0 (2014-06-30)
     113
     114* Support removing a selector from a declaration block using `$oBlock->removeSelector($mSelector)`
     115* Introduce a specialized exception (Sabberworm\CSS\Parsing\OuputException) for exceptions during output rendering
     116
     117* *No deprecations*
     118
    49119#### Backwards-incompatible changes
    50120
    51 * The `Sabberworm\CSS\Value\String` class has been renamed to `Sabberworm\CSS\Value\CSSString`.
    52 
    53 ### 7.0.1 (2015-12-25)
    54 
    55 * No more suppressed `E_NOTICE`
    56 * *No backwards-incompatible changes*
    57 * *No deprecations*
    58 
    59 ### 7.0.2 (2016-02-11)
    60 
    61 * 150 time performance boost thanks to @[ossinkine](https://github.com/ossinkine)
    62 * *No backwards-incompatible changes*
    63 * *No deprecations*
    64 
    65 ### 7.0.3 (2016-04-27)
    66 
    67 * Fixed parsing empty CSS when multibyte is off
    68 * *No backwards-incompatible changes*
    69 * *No deprecations*
    70 
    71 ## 6.0
    72 
    73 ### 6.0.0 (2014-07-03)
    74 
    75 * Format output using Sabberworm\CSS\OutputFormat
    76 * *No backwards-incompatible changes*
    77 
    78 #### Deprecations
    79 
    80 * The parse() method replaces __toString with an optional argument (instance of the OutputFormat class)
    81 
    82 ### 6.0.1 (2015-08-24)
    83 
    84 * Remove some declarations in interfaces incompatible with PHP 5.3 (< 5.3.9)
    85 * *No deprecations*
    86 
    87 ## 5.0
    88 
    89 ### 5.0.0 (2013-03-20)
     121* Outputting a declaration block that has no selectors throws an OuputException instead of outputting an invalid ` {…}` into the CSS document.
     122
     123## 5.1.2 (2013-10-30)
     124
     125* Remove the use of consumeUntil in comment parsing. This makes it possible to parse comments such as `/** Perfectly valid **/`
     126* Add fr relative size unit
     127* Fix some issues with HHVM
     128* *No backwards-incompatible changes*
     129* *No deprecations*
     130
     131## 5.1.1 (2013-10-28)
     132
     133* Updated CHANGELOG.md to reflect changes since 5.0.4
     134* *No backwards-incompatible changes*
     135* *No deprecations*
     136
     137## 5.1.0 (2013-10-24)
     138
     139* Performance enhancements by Michael M Slusarz
     140* More rescue entry points for lenient parsing (unexpected tokens between declaration blocks and unclosed comments)
     141* *No backwards-incompatible changes*
     142* *No deprecations*
     143
     144## 5.0.8 (2013-08-15)
     145
     146* Make default settings’ multibyte parsing option dependent on whether or not the mbstring extension is actually installed.
     147* *No backwards-incompatible changes*
     148* *No deprecations*
     149
     150## 5.0.7 (2013-08-04)
     151
     152* Fix broken decimal point output optimization
     153* *No backwards-incompatible changes*
     154* *No deprecations*
     155
     156## 5.0.6 (2013-05-31)
     157
     158* Fix broken unit test
     159* *No backwards-incompatible changes*
     160* *No deprecations*
     161
     162## 5.0.5 (2013-04-17)
     163
     164* Initial support for lenient parsing (setting this parser option will catch some exceptions internally and recover the parser’s state as neatly as possible).
     165* *No backwards-incompatible changes*
     166* *No deprecations*
     167
     168## 5.0.4 (2013-03-21)
     169
     170* Don’t output floats with locale-aware separator chars
     171* *No backwards-incompatible changes*
     172* *No deprecations*
     173
     174## 5.0.3 (2013-03-21)
     175
     176* More size units recognized
     177* *No backwards-incompatible changes*
     178* *No deprecations*
     179
     180## 5.0.2 (2013-03-21)
     181
     182* CHANGELOG.md file added to distribution
     183* *No backwards-incompatible changes*
     184* *No deprecations*
     185
     186## 5.0.1 (2013-03-20)
     187
     188* Internal cleanup
     189* *No backwards-incompatible changes*
     190* *No deprecations*
     191
     192## 5.0.0 (2013-03-20)
    90193
    91194* Correctly parse all known CSS 3 units (including Hz and kHz).
     
    94197* *No deprecations*
    95198
    96 #### Backwards-incompatible changes
     199### Backwards-incompatible changes
    97200
    98201* `Sabberworm\CSS\Value\Color`’s `__toString` method overrides `CSSList`’s to maybe return something other than `type(value, …)` (see above).
    99202
    100 ### 5.0.1 (2013-03-20)
    101 
    102 * Internal cleanup
    103 * *No backwards-incompatible changes*
    104 * *No deprecations*
    105 
    106 ### 5.0.2 (2013-03-21)
    107 
    108 * CHANGELOG.md file added to distribution
    109 * *No backwards-incompatible changes*
    110 * *No deprecations*
    111 
    112 ### 5.0.3 (2013-03-21)
    113 
    114 * More size units recognized
    115 * *No backwards-incompatible changes*
    116 * *No deprecations*
    117 
    118 ### 5.0.4 (2013-03-21)
    119 
    120 * Don’t output floats with locale-aware separator chars
    121 * *No backwards-incompatible changes*
    122 * *No deprecations*
    123 
    124 ### 5.0.5 (2013-04-17)
    125 
    126 * Initial support for lenient parsing (setting this parser option will catch some exceptions internally and recover the parser’s state as neatly as possible).
    127 * *No backwards-incompatible changes*
    128 * *No deprecations*
    129 
    130 ### 5.0.6 (2013-05-31)
    131 
    132 * Fix broken unit test
    133 * *No backwards-incompatible changes*
    134 * *No deprecations*
    135 
    136 ### 5.0.7 (2013-08-04)
    137 
    138 * Fix broken decimal point output optimization
    139 * *No backwards-incompatible changes*
    140 * *No deprecations*
    141 
    142 ### 5.0.8 (2013-08-15)
    143 
    144 * Make default settings’ multibyte parsing option dependent on whether or not the mbstring extension is actually installed.
    145 * *No backwards-incompatible changes*
    146 * *No deprecations*
    147 
    148 ### 5.1.0 (2013-10-24)
    149 
    150 * Performance enhancements by Michael M Slusarz
    151 * More rescue entry points for lenient parsing (unexpected tokens between declaration blocks and unclosed comments)
    152 * *No backwards-incompatible changes*
    153 * *No deprecations*
    154 
    155 ### 5.1.1 (2013-10-28)
    156 
    157 * Updated CHANGELOG.md to reflect changes since 5.0.4
    158 * *No backwards-incompatible changes*
    159 * *No deprecations*
    160 
    161 ### 5.1.2 (2013-10-30)
    162 
    163 * Remove the use of consumeUntil in comment parsing. This makes it possible to parse comments such as `/** Perfectly valid **/`
    164 * Add fr relative size unit
    165 * Fix some issues with HHVM
    166 * *No backwards-incompatible changes*
    167 * *No deprecations*
    168 
    169 ### 5.2.0 (2014-06-30)
    170 
    171 * Support removing a selector from a declaration block using `$oBlock->removeSelector($mSelector)`
    172 * Introduce a specialized exception (Sabberworm\CSS\Parsing\OuputException) for exceptions during output rendering
    173 
    174 * *No deprecations*
    175 
    176 #### Backwards-incompatible changes
    177 
    178 * Outputting a declaration block that has no selectors throws an OuputException instead of outputting an invalid ` {…}` into the CSS document.
    179 
    180 ## 4.0
    181 
    182 ### 4.0.0 (2013-03-19)
     203## 4.0.0 (2013-03-19)
    183204
    184205* Support for more @-rules
     
    186207* *No deprecations*
    187208
    188 #### Backwards-incompatible changes
     209### Backwards-incompatible changes
    189210
    190211* `Sabberworm\CSS\RuleSet\AtRule` renamed to `Sabberworm\CSS\RuleSet\AtRuleSet`
    191212* `Sabberworm\CSS\CSSList\MediaQuery` renamed to `Sabberworm\CSS\RuleSet\CSSList\AtRuleBlockList` with differing semantics and API (which also works for other block-list-based @-rules like `@supports`).
    192213
    193 ## 3.0
    194 
    195 ### 3.0.0 (2013-03-06)
     214## 3.0.0 (2013-03-06)
    196215
    197216* Support for lenient parsing (on by default)
    198217* *No deprecations*
    199218
    200 #### Backwards-incompatible changes
     219### Backwards-incompatible changes
    201220
    202221* All properties (like whether or not to use `mb_`-functions, which default charset to use and – new – whether or not to be forgiving when parsing) are now encapsulated in an instance of `Sabberworm\CSS\Settings` which can be passed as the second argument to `Sabberworm\CSS\Parser->__construct()`.
     
    205224* `Sabberworm\CSS\Parser->parse()` may throw a `Sabberworm\CSS\Parsing\UnexpectedTokenException` when in strict parsing mode.
    206225
    207 ## 2.0
    208 
    209 ### 2.0.0 (2013-01-29)
     226## 2.0.0 (2013-01-29)
    210227
    211228* Allow multiple rules of the same type per rule set
    212229
    213 #### Backwards-incompatible changes
     230### Backwards-incompatible changes
    214231
    215232* `Sabberworm\CSS\RuleSet->getRules()` returns an index-based array instead of an associative array. Use `Sabberworm\CSS\RuleSet->getRulesAssoc()` (which eliminates duplicate rules and lets the later rule of the same name win).
  • wp-html-mail/trunk/vendor/sabberworm/php-css-parser/README.md

    r2259567 r3058117  
    1 PHP CSS Parser
    2 --------------
    3 
    4 [![build status](https://api.travis-ci.org/sabberworm/PHP-CSS-Parser.svg)](https://travis-ci.org/sabberworm/PHP-CSS-Parser) [![HHVM Status](http://hhvm.h4cc.de/badge/sabberworm/php-css-parser.svg)](http://hhvm.h4cc.de/package/sabberworm/php-css-parser)
     1# PHP CSS Parser
     2
     3[![Build Status](https://github.com/sabberworm/PHP-CSS-Parser/workflows/CI/badge.svg?branch=master)](https://github.com/sabberworm/PHP-CSS-Parser/actions/)
    54
    65A Parser for CSS Files written in PHP. Allows extraction of CSS files into a data structure, manipulation of said structure and output as (optimized) CSS.
     
    87## Usage
    98
    10 ### Installation using composer
    11 
    12 Add php-css-parser to your composer.json
    13 
    14 ```json
    15 {
    16     "require": {
    17         "sabberworm/php-css-parser": "*"
    18     }
    19 }
     9### Installation using Composer
     10
     11```bash
     12composer require sabberworm/php-css-parser
    2013```
    2114
     
    2518
    2619```php
    27 new Sabberworm\CSS\Parser($sText);
     20new \Sabberworm\CSS\Parser($css);
    2821```
    2922
     
    3124
    3225```php
    33 $oCssParser = new Sabberworm\CSS\Parser(file_get_contents('somefile.css'));
    34 $oCssDocument = $oCssParser->parse();
     26$parser = new \Sabberworm\CSS\Parser(file_get_contents('somefile.css'));
     27$cssDocument = $parser->parse();
    3528```
    3629
     
    4134#### Charset
    4235
    43 The charset option is used only if no @charset declaration is found in the CSS file. UTF-8 is the default, so you won’t have to create a settings object at all if you don’t intend to change that.
    44 
    45 ```php
    46 $oSettings = Sabberworm\CSS\Settings::create()->withDefaultCharset('windows-1252');
    47 new Sabberworm\CSS\Parser($sText, $oSettings);
     36The charset option is used only if no `@charset` declaration is found in the CSS file. UTF-8 is the default, so you won’t have to create a settings object at all if you don’t intend to change that.
     37
     38```php
     39$settings = \Sabberworm\CSS\Settings::create()
     40    ->withDefaultCharset('windows-1252');
     41$parser = new \Sabberworm\CSS\Parser($css, $settings);
    4842```
    4943
    5044#### Strict parsing
    5145
    52 To have the parser choke on invalid rules, supply a thusly configured Sabberworm\CSS\Settings object:
    53 
    54 ```php
    55 $oCssParser = new Sabberworm\CSS\Parser(file_get_contents('somefile.css'), Sabberworm\CSS\Settings::create()->beStrict());
     46To have the parser choke on invalid rules, supply a thusly configured `\Sabberworm\CSS\Settings` object:
     47
     48```php
     49$parser = new \Sabberworm\CSS\Parser(
     50    file_get_contents('somefile.css'),
     51    \Sabberworm\CSS\Settings::create()->beStrict()
     52);
    5653```
    5754
    5855#### Disable multibyte functions
    5956
    60 To achieve faster parsing, you can choose to have PHP-CSS-Parser use regular string functions instead of `mb_*` functions. This should work fine in most cases, even for UTF-8 files, as all the multibyte characters are in string literals. Still it’s not recommended to use this with input you have no control over as it’s not thoroughly covered by test cases.
    61 
    62 ```php
    63 $oSettings = Sabberworm\CSS\Settings::create()->withMultibyteSupport(false);
    64 new Sabberworm\CSS\Parser($sText, $oSettings);
     57To achieve faster parsing, you can choose to have PHP-CSS-Parser use regular string functions instead of `mb_*` functions. This should work fine in most cases, even for UTF-8 files, as all the multibyte characters are in string literals. Still it’s not recommended using this with input you have no control over as it’s not thoroughly covered by test cases.
     58
     59```php
     60$settings = \Sabberworm\CSS\Settings::create()->withMultibyteSupport(false);
     61$parser = new \Sabberworm\CSS\Parser($css, $settings);
    6562```
    6663
    6764### Manipulation
    6865
    69 The resulting data structure consists mainly of five basic types: `CSSList`, `RuleSet`, `Rule`, `Selector` and `Value`. There are two additional types used: `Import` and `Charset` which you won’t use often.
     66The resulting data structure consists mainly of five basic types: `CSSList`, `RuleSet`, `Rule`, `Selector` and `Value`. There are two additional types used: `Import` and `Charset`, which you won’t use often.
    7067
    7168#### CSSList
    7269
    73 `CSSList` represents a generic CSS container, most likely containing declaration blocks (rule sets with a selector) but it may also contain at-rules, charset declarations, etc. `CSSList` has the following concrete subtypes:
     70`CSSList` represents a generic CSS container, most likely containing declaration blocks (rule sets with a selector), but it may also contain at-rules, charset declarations, etc. `CSSList` has the following concrete subtypes:
    7471
    7572* `Document` – representing the root of a CSS file.
    76 * `MediaQuery` – represents a subsection of a CSSList that only applies to a output device matching the contained media query.
    77 
    78 To access the items stored in a `CSSList` – like the document you got back when calling `$oCssParser->parse()` –, use `getContents()`, then iterate over that collection and use instanceof to check whether you’re dealing with another `CSSList`, a `RuleSet`, a `Import` or a `Charset`.
     73* `MediaQuery` – represents a subsection of a `CSSList` that only applies to an output device matching the contained media query.
     74
     75To access the items stored in a `CSSList` – like the document you got back when calling `$parser->parse()` –, use `getContents()`, then iterate over that collection and use instanceof to check whether you’re dealing with another `CSSList`, a `RuleSet`, a `Import` or a `Charset`.
    7976
    8077To append a new item (selector, media query, etc.) to an existing `CSSList`, construct it using the constructor for this class and use the `append($oItem)` method.
     
    8481`RuleSet` is a container for individual rules. The most common form of a rule set is one constrained by a selector. The following concrete subtypes exist:
    8582
    86 * `AtRuleSet` – for generic at-rules which do not match the ones specifically mentioned like @import, @charset or @media. A common example for this is @font-face.
    87 * `DeclarationBlock` – a RuleSet constrained by a `Selector`; contains an array of selector objects (comma-separated in the CSS) as well as the rules to be applied to the matching elements.
    88 
    89 Note: A `CSSList` can contain other `CSSList`s (and `Import`s as well as a `Charset`) while a `RuleSet` can only contain `Rule`s.
    90 
    91 If you want to manipulate a `RuleSet`, use the methods `addRule(Rule $oRule)`, `getRules()` and `removeRule($mRule)` (which accepts either a Rule instance or a rule name; optionally suffixed by a dash to remove all related rules).
     83* `AtRuleSet` – for generic at-rules which do not match the ones specifically mentioned like `@import`, `@charset` or `@media`. A common example for this is `@font-face`.
     84* `DeclarationBlock` – a `RuleSet` constrained by a `Selector`; contains an array of selector objects (comma-separated in the CSS) as well as the rules to be applied to the matching elements.
     85
     86Note: A `CSSList` can contain other `CSSList`s (and `Import`s as well as a `Charset`), while a `RuleSet` can only contain `Rule`s.
     87
     88If you want to manipulate a `RuleSet`, use the methods `addRule(Rule $rule)`, `getRules()` and `removeRule($rule)` (which accepts either a `Rule` instance or a rule name; optionally suffixed by a dash to remove all related rules).
    9289
    9390#### Rule
     
    119116## To-Do
    120117
    121 * More convenience methods [like `selectorsWithElement($sId/Class/TagName)`, `attributesOfType($sType)`, `removeAttributesOfType($sType)`]
    122 * Real multibyte support. Currently only multibyte charsets whose first 255 code points take up only one byte and are identical with ASCII are supported (yes, UTF-8 fits this description).
     118* More convenience methods (like `selectorsWithElement($sId/Class/TagName)`, `attributesOfType($type)`, `removeAttributesOfType($type)`)
     119* Real multibyte support. Currently, only multibyte charsets whose first 255 code points take up only one byte and are identical with ASCII are supported (yes, UTF-8 fits this description).
    123120* Named color support (using `Color` instead of an anonymous string literal)
    124121
    125122## Use cases
    126123
    127 ### Use `Parser` to prepend an id to all selectors
    128 
    129 ```php
    130 $sMyId = "#my_id";
    131 $oParser = new Sabberworm\CSS\Parser($sText);
    132 $oCss = $oParser->parse();
    133 foreach($oCss->getAllDeclarationBlocks() as $oBlock) {
    134     foreach($oBlock->getSelectors() as $oSelector) {
    135         //Loop over all selector parts (the comma-separated strings in a selector) and prepend the id
    136         $oSelector->setSelector($sMyId.' '.$oSelector->getSelector());
    137     }
     124### Use `Parser` to prepend an ID to all selectors
     125
     126```php
     127$myId = "#my_id";
     128$parser = new \Sabberworm\CSS\Parser($css);
     129$cssDocument = $parser->parse();
     130foreach ($cssDocument->getAllDeclarationBlocks() as $block) {
     131    foreach ($block->getSelectors() as $selector) {
     132        // Loop over all selector parts (the comma-separated strings in a
     133        // selector) and prepend the ID.
     134        $selector->setSelector($myId.' '.$selector->getSelector());
     135    }
    138136}
    139137```
     
    142140
    143141```php
    144 $oParser = new Sabberworm\CSS\Parser($sText);
    145 $oCss = $oParser->parse();
    146 foreach($oCss->getAllValues() as $mValue) {
    147     if($mValue instanceof CSSSize && !$mValue->isRelative()) {
    148         $mValue->setSize($mValue->getSize()/2);
    149     }
     142$parser = new \Sabberworm\CSS\Parser($css);
     143$cssDocument = $parser->parse();
     144foreach ($cssDocument->getAllValues() as $value) {
     145    if ($value instanceof CSSSize && !$value->isRelative()) {
     146        $value->setSize($value->getSize() / 2);
     147    }
    150148}
    151149```
     
    154152
    155153```php
    156 $oParser = new Sabberworm\CSS\Parser($sText);
    157 $oCss = $oParser->parse();
    158 foreach($oCss->getAllRuleSets() as $oRuleSet) {
    159     $oRuleSet->removeRule('font-'); //Note that the added dash will make this remove all rules starting with font- (like font-size, font-weight, etc.) as well as a potential font-rule
    160     $oRuleSet->removeRule('cursor');
     154$parser = new \Sabberworm\CSS\Parser($css);
     155$cssDocument = $parser->parse();
     156foreach($cssDocument->getAllRuleSets() as $oRuleSet) {
     157    // Note that the added dash will make this remove all rules starting with
     158    // `font-` (like `font-size`, `font-weight`, etc.) as well as a potential
     159    // `font-rule`.
     160    $oRuleSet->removeRule('font-');
     161    $oRuleSet->removeRule('cursor');
    161162}
    162163```
     
    167168
    168169```php
    169 $oCssParser = new Sabberworm\CSS\Parser(file_get_contents('somefile.css'));
    170 $oCssDocument = $oCssParser->parse();
    171 print $oCssDocument->render();
    172 ```
    173 
    174 If you want to format the output, pass an instance of type `Sabberworm\CSS\OutputFormat`:
    175 
    176 ```php
    177 $oFormat = Sabberworm\CSS\OutputFormat::create()->indentWithSpaces(4)->setSpaceBetweenRules("\n");
    178 print $oCssDocument->render($oFormat);
     170$parser = new \Sabberworm\CSS\Parser(file_get_contents('somefile.css'));
     171$cssDocument = $parser->parse();
     172print $cssDocument->render();
     173```
     174
     175If you want to format the output, pass an instance of type `\Sabberworm\CSS\OutputFormat`:
     176
     177```php
     178$format = \Sabberworm\CSS\OutputFormat::create()
     179    ->indentWithSpaces(4)->setSpaceBetweenRules("\n");
     180print $cssDocument->render($format);
    179181```
    180182
     
    182184
    183185```php
    184 print $oCssDocument->render(Sabberworm\CSS\OutputFormat::createPretty());
    185 print $oCssDocument->render(Sabberworm\CSS\OutputFormat::createCompact());
    186 ```
    187 
    188 To see what you can do with output formatting, look at the tests in `tests/Sabberworm/CSS/OutputFormatTest.php`.
     186print $cssDocument->render(Sabberworm\CSS\OutputFormat::createPretty());
     187print $cssDocument->render(Sabberworm\CSS\OutputFormat::createCompact());
     188```
     189
     190To see what you can do with output formatting, look at the tests in `tests/OutputFormatTest.php`.
    189191
    190192## Examples
     
    199201@font-face {
    200202  font-family: "CrassRoots";
    201   src: url("../media/cr.ttf")
     203  src: url("../media/cr.ttf");
    202204}
    203205
    204206html, body {
    205     font-size: 1.6em
     207    font-size: 1.6em;
    206208}
    207209
    208210@keyframes mymove {
    209     from { top: 0px; }
    210     to { top: 200px; }
     211    from { top: 0px; }
     212    to { top: 200px; }
    211213}
    212214
     
    441443@font-face {font-family: "CrassRoots";src: url("../media/cr.ttf");}
    442444html, body {font-size: 1.6em;}
    443 @keyframes mymove {from {top: 0px;}
    444     to {top: 200px;}}
     445@keyframes mymove {from {top: 0px;} to {top: 200px;}}
    445446```
    446447
     
    451452```css
    452453#header {
    453     margin: 10px 2em 1cm 2%;
    454     font-family: Verdana, Helvetica, "Gill Sans", sans-serif;
    455     color: red !important;
     454    margin: 10px 2em 1cm 2%;
     455    font-family: Verdana, Helvetica, "Gill Sans", sans-serif;
     456    color: red !important;
    456457}
    457458
     
    612613## Contributors/Thanks to
    613614
     615* [oliverklee](https://github.com/oliverklee) for lots of refactorings, code modernizations and CI integrations
    614616* [raxbg](https://github.com/raxbg) for contributions to parse `calc`, grid lines, and various bugfixes.
    615617* [westonruter](https://github.com/westonruter) for bugfixes and improvements.
     
    618620* [ju1ius](https://github.com/ju1ius) for the specificity parsing code and the ability to expand/compact shorthand properties.
    619621* [ossinkine](https://github.com/ossinkine) for a 150 time performance boost.
    620 * [GaryJones](https://github.com/GaryJones) for lots of input and [http://css-specificity.info/](http://css-specificity.info/).
     622* [GaryJones](https://github.com/GaryJones) for lots of input and [https://css-specificity.info/](https://css-specificity.info/).
    621623* [docteurklein](https://github.com/docteurklein) for output formatting and `CSSList->remove()` inspiration.
    622624* [nicolopignatelli](https://github.com/nicolopignatelli) for PSR-0 compatibility.
     
    628630
    629631* Legacy Support: The latest pre-PSR-0 version of this project can be checked with the `0.9.0` tag.
    630 * Running Tests: To run all unit tests for this project, run `composer install` to install phpunit and use `./vendor/phpunit/phpunit/phpunit`.
    631 
    632 ## License
    633 
    634 PHP-CSS-Parser is freely distributable under the terms of an MIT-style license.
    635 
    636 Copyright (c) 2011 Raphael Schweikert, http://sabberworm.com/
    637 
    638 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
    639 
    640 The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
    641 
    642 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
     632* Running Tests: To run all unit tests for this project, run `composer install` to install phpunit and use `./vendor/bin/phpunit`.
  • wp-html-mail/trunk/vendor/sabberworm/php-css-parser/composer.json

    r2800468 r3058117  
    33    "type": "library",
    44    "description": "Parser for CSS Files written in PHP",
    5     "keywords": ["parser", "css", "stylesheet"],
    6     "homepage": "http://www.sabberworm.com/blog/2010/6/10/php-css-parser",
     5    "keywords": [
     6        "parser",
     7        "css",
     8        "stylesheet"
     9    ],
     10    "homepage": "https://www.sabberworm.com/blog/2010/6/10/php-css-parser",
    711    "license": "MIT",
    812    "authors": [
    9         {"name": "Raphael Schweikert"}
     13        {
     14            "name": "Raphael Schweikert"
     15        }
    1016    ],
    1117    "require": {
    12         "php": ">=5.3.2"
     18        "php": ">=5.6.20",
     19        "ext-iconv": "*"
    1320    },
    1421    "require-dev": {
    15         "phpunit/phpunit": "~4.8",
     22        "phpunit/phpunit": "^4.8.36",
    1623        "codacy/coverage": "^1.4"
    1724    },
     25    "suggest": {
     26        "ext-mbstring": "for parsing UTF-8 CSS"
     27    },
    1828    "autoload": {
    19         "psr-0": { "Sabberworm\\CSS": "lib/" }
     29        "psr-4": {
     30            "Sabberworm\\CSS\\": "src/"
     31        }
     32    },
     33    "autoload-dev": {
     34        "psr-4": {
     35            "Sabberworm\\CSS\\Tests\\": "tests/"
     36        }
     37    },
     38    "scripts": {
     39        "ci": [
     40            "@ci:static"
     41        ],
     42        "ci:php:fixer": "@php ./.phive/php-cs-fixer.phar --config=config/php-cs-fixer.php fix --dry-run -v --show-progress=dots bin src tests",
     43        "ci:php:sniffer": "@php ./.phive/phpcs.phar --standard=config/phpcs.xml bin src tests",
     44        "ci:php:stan": "@php ./.phive/phpstan.phar --configuration=config/phpstan.neon",
     45        "ci:static": [
     46            "@ci:php:fixer",
     47            "@ci:php:sniffer",
     48            "@ci:php:stan"
     49        ],
     50        "fix:php": [
     51            "@fix:php:fixer",
     52            "@fix:php:sniffer"
     53        ],
     54        "fix:php:fixer": "@php ./.phive/php-cs-fixer.phar --config=config/php-cs-fixer.php fix bin src tests",
     55        "fix:php:sniffer": "@php ./.phive/phpcbf.phar --standard=config/phpcs.xml bin src tests",
     56        "phpstan:baseline": "@php ./.phive/phpstan.phar --configuration=config/phpstan.neon --generate-baseline=config/phpstan-baseline.neon"
     57    },
     58    "scripts-descriptions": {
     59        "ci": "Runs all dynamic and static code checks (i.e. currently, only the static checks).",
     60        "ci:php:fixer": "Checks the code style with PHP CS Fixer.",
     61        "ci:php:sniffer": "Checks the code style with PHP_CodeSniffer.",
     62        "ci:php:stan": "Checks the types with PHPStan.",
     63        "ci:static": "Runs all static code analysis checks for the code.",
     64        "fix:php": "Autofixes all autofixable issues in the PHP code.",
     65        "fix:php:fixer": "Fixes autofixable issues found by PHP CS Fixer.",
     66        "fix:php:sniffer": "Fixes autofixable issues found by PHP_CodeSniffer.",
     67        "phpstand:baseline": "Updates the PHPStan baseline file to match the code."
    2068    }
    2169}
  • wp-html-mail/trunk/vendor/symfony/css-selector/LICENSE

    r2525778 r3058117  
    1 Copyright (c) 2004-2021 Fabien Potencier
     1Copyright (c) 2004-present Fabien Potencier
    22
    33Permission is hereby granted, free of charge, to any person obtaining a copy
  • wp-html-mail/trunk/vendor/symfony/css-selector/Node/AttributeNode.php

    r2259567 r3058117  
    7272    }
    7373
    74     /**
    75      * {@inheritdoc}
    76      */
    7774    public function __toString(): string
    7875    {
  • wp-html-mail/trunk/vendor/symfony/css-selector/Node/ClassNode.php

    r2259567 r3058117  
    5151    }
    5252
    53     /**
    54      * {@inheritdoc}
    55      */
    5653    public function __toString(): string
    5754    {
  • wp-html-mail/trunk/vendor/symfony/css-selector/Node/CombinedSelectorNode.php

    r2259567 r3058117  
    5858    }
    5959
    60     /**
    61      * {@inheritdoc}
    62      */
    6360    public function __toString(): string
    6461    {
  • wp-html-mail/trunk/vendor/symfony/css-selector/Node/ElementNode.php

    r2259567 r3058117  
    5151    }
    5252
    53     /**
    54      * {@inheritdoc}
    55      */
    5653    public function __toString(): string
    5754    {
  • wp-html-mail/trunk/vendor/symfony/css-selector/Node/FunctionNode.php

    r2259567 r3058117  
    6666    }
    6767
    68     /**
    69      * {@inheritdoc}
    70      */
    7168    public function __toString(): string
    7269    {
  • wp-html-mail/trunk/vendor/symfony/css-selector/Node/HashNode.php

    r2259567 r3058117  
    5151    }
    5252
    53     /**
    54      * {@inheritdoc}
    55      */
    5653    public function __toString(): string
    5754    {
  • wp-html-mail/trunk/vendor/symfony/css-selector/Node/NegationNode.php

    r2259567 r3058117  
    5151    }
    5252
    53     /**
    54      * {@inheritdoc}
    55      */
    5653    public function __toString(): string
    5754    {
  • wp-html-mail/trunk/vendor/symfony/css-selector/Node/PseudoNode.php

    r2259567 r3058117  
    5151    }
    5252
    53     /**
    54      * {@inheritdoc}
    55      */
    5653    public function __toString(): string
    5754    {
  • wp-html-mail/trunk/vendor/symfony/css-selector/Node/SelectorNode.php

    r2259567 r3058117  
    5151    }
    5252
    53     /**
    54      * {@inheritdoc}
    55      */
    5653    public function __toString(): string
    5754    {
  • wp-html-mail/trunk/vendor/symfony/css-selector/Parser/Parser.php

    r2560935 r3058117  
    8080            case 'n' === $joined:
    8181                return [1, 0];
    82             case false === strpos($joined, 'n'):
     82            case !str_contains($joined, 'n'):
    8383                return [0, $int($joined)];
    8484        }
  • wp-html-mail/trunk/vendor/symfony/css-selector/Parser/TokenStream.php

    r2259567 r3058117  
    119119
    120120    /**
    121      * Returns nex identifier token.
    122      *
    123      * @return string The identifier token value
     121     * Returns next identifier token.
    124122     *
    125123     * @throws SyntaxErrorException If next token is not an identifier
     
    137135
    138136    /**
    139      * Returns nex identifier or star delimiter token.
    140      *
    141      * @return string|null The identifier token value or null if star found
     137     * Returns next identifier or null if star delimiter token is found.
    142138     *
    143139     * @throws SyntaxErrorException If next token is not an identifier or a star delimiter
  • wp-html-mail/trunk/vendor/symfony/css-selector/Parser/Tokenizer/TokenizerPatterns.php

    r2259567 r3058117  
    5050        $this->hashPattern = '#((?:'.$this->nmCharPattern.')+)';
    5151        $this->numberPattern = '[+-]?(?:[0-9]*\.[0-9]+|[0-9]+)';
    52         $this->quotedStringPattern = '([^\n\r\f%s]|'.$this->stringEscapePattern.')*';
     52        $this->quotedStringPattern = '([^\n\r\f\\\\%s]|'.$this->stringEscapePattern.')*';
    5353    }
    5454
    5555    public function getNewLineEscapePattern(): string
    5656    {
    57         return '~^'.$this->newLineEscapePattern.'~';
     57        return '~'.$this->newLineEscapePattern.'~';
    5858    }
    5959
    6060    public function getSimpleEscapePattern(): string
    6161    {
    62         return '~^'.$this->simpleEscapePattern.'~';
     62        return '~'.$this->simpleEscapePattern.'~';
    6363    }
    6464
    6565    public function getUnicodeEscapePattern(): string
    6666    {
    67         return '~^'.$this->unicodeEscapePattern.'~i';
     67        return '~'.$this->unicodeEscapePattern.'~i';
    6868    }
    6969
  • wp-html-mail/trunk/vendor/symfony/css-selector/XPath/Translator.php

    r2560935 r3058117  
    6464    public static function getXpathLiteral(string $element): string
    6565    {
    66         if (false === strpos($element, "'")) {
     66        if (!str_contains($element, "'")) {
    6767            return "'".$element."'";
    6868        }
    6969
    70         if (false === strpos($element, '"')) {
     70        if (!str_contains($element, '"')) {
    7171            return '"'.$element.'"';
    7272        }
     
    204204     * @throws ExpressionErrorException
    205205     */
    206     public function addAttributeMatching(XPathExpr $xpath, string $operator, string $attribute, $value): XPathExpr
     206    public function addAttributeMatching(XPathExpr $xpath, string $operator, string $attribute, ?string $value): XPathExpr
    207207    {
    208208        if (!isset($this->attributeMatchingTranslators[$operator])) {
  • wp-html-mail/trunk/vendor/symfony/css-selector/XPath/XPathExpr.php

    r2259567 r3058117  
    4444    }
    4545
     46    /**
     47     * @return $this
     48     */
    4649    public function addCondition(string $condition): self
    4750    {
     
    5659    }
    5760
     61    /**
     62     * @return $this
     63     */
    5864    public function addNameTest(): self
    5965    {
     
    6672    }
    6773
     74    /**
     75     * @return $this
     76     */
    6877    public function addStarPrefix(): self
    6978    {
  • wp-html-mail/trunk/vendor/symfony/css-selector/composer.json

    r2800468 r3058117  
    2121    ],
    2222    "require": {
    23         "php": ">=7.2.5"
     23        "php": ">=7.2.5",
     24        "symfony/polyfill-php80": "^1.16"
    2425    },
    2526    "autoload": {
  • wp-html-mail/trunk/vendor/voku/simple_html_dom/CHANGELOG

    r2560935 r3058117  
     1[PHP Simple HTML Dom v4.8.x]
     20: refactor -> findOne() -> will now return always an "Blank" object if no element was found
     31: "SimpleXmlDomNodeInterface" -> fix phpdocs only
     42: "*NodeBlank" -> fix return type from "findOne()"
     53: "innerhtmlKeep" -> added for modifying html without loosing html-hacks for e.g. svg elements
     64: "HtmlDomHelper" -> added "mergeHtmlAttributes()"
     75: "HtmlDomParser" -> hack for multiple root elements
     86: "AbstractSimpleHtmlDom" -> PHP 8.1 -> try to fix php type errors
     97: "XmlDomParser" -> added workaround for DTD requests
     108: "Replace deprecated string interpolation usage" thanks @flavioheleno [Flávio Heleno]
    111
    212[PHP Simple HTML Dom v4.7.x]
     
    273728: fix -> allow CSS and xPath syntax for XmlDomParser
    283829: use github actions
    29 
     3930: add "previousNonWhitespaceSibling()"
     4031: add "SimpleHtmlDom->delete()" & "SimpleHtmlDom->getTag()" thanks @marioquartz
     41    add support for "symfony/css-selector": ~6.0 thanks @dora38
    3042
    3143[PHP Simple HTML Dom v4.6.x]
  • wp-html-mail/trunk/vendor/voku/simple_html_dom/README_API.md

    r2560935 r3058117  
    44### DomParser API
    55
    6 <p id="voku-php-readme-class-methods"></p><table><tr><td><a href="#findstring-selector-intnull-idx">find</a>
    7 </td><td><a href="#findmultistring-selector">findMulti</a>
    8 </td><td><a href="#findmultiorfalsestring-selector">findMultiOrFalse</a>
    9 </td><td><a href="#findonestring-selector">findOne</a>
    10 </td></tr><tr><td><a href="#findoneorfalsestring-selector">findOneOrFalse</a>
     6<p id="voku-php-readme-class-methods"></p><table><tr><td><a href="#findstring-selector-intnull-idx-mixed">find</a>
     7</td><td><a href="#findmultistring-selector-mixed">findMulti</a>
     8</td><td><a href="#findmultiorfalsestring-selector-mixed">findMultiOrFalse</a>
     9</td><td><a href="#findonestring-selector-static">findOne</a>
     10</td></tr><tr><td><a href="#findoneorfalsestring-selector-mixed">findOneOrFalse</a>
    1111</td><td><a href="#fixhtmloutputstring-content-bool-multidecodenewhtmlentity-string">fixHtmlOutput</a>
    1212</td><td><a href="#getdocument-domdocument">getDocument</a>
    13 </td><td><a href="#getelementbyclassstring-class">getElementByClass</a>
    14 </td></tr><tr><td><a href="#getelementbyidstring-id">getElementById</a>
    15 </td><td><a href="#getelementbytagnamestring-name">getElementByTagName</a>
    16 </td><td><a href="#getelementsbyidstring-id-intnull-idx">getElementsById</a>
    17 </td><td><a href="#getelementsbytagnamestring-name-intnull-idx">getElementsByTagName</a>
     13</td><td><a href="#getelementbyclassstring-class-mixed">getElementByClass</a>
     14</td></tr><tr><td><a href="#getelementbyidstring-id-mixed">getElementById</a>
     15</td><td><a href="#getelementbytagnamestring-name-mixed">getElementByTagName</a>
     16</td><td><a href="#getelementsbyidstring-id-intnull-idx-mixed">getElementsById</a>
     17</td><td><a href="#getelementsbytagnamestring-name-intnull-idx-mixed">getElementsByTagName</a>
    1818</td></tr><tr><td><a href="#htmlbool-multidecodenewhtmlentity-string">html</a>
    1919</td><td><a href="#innerhtmlbool-multidecodenewhtmlentity-string">innerHtml</a>
     
    2222</td></tr><tr><td><a href="#loadhtmlfilestring-filepath-intnull-libxmlextraoptions-domparserinterface">loadHtmlFile</a>
    2323</td><td><a href="#savestring-filepath-string">save</a>
    24 </td><td><a href="#set_callbackcallable-functionname">set_callback</a>
     24</td><td><a href="#set_callbackcallable-functionname-mixed">set_callback</a>
    2525</td><td><a href="#textbool-multidecodenewhtmlentity-string">text</a>
    2626</td></tr><tr><td><a href="#xmlbool-multidecodenewhtmlentity-bool-htmltoxml-bool-removexmlheader-int-options-string">xml</a>
     
    4444
    4545<p id="voku-php-readme-class-methods"></p><table><tr><td><a href="#childnodesint-idx-simplehtmldominterfacesimplehtmldominterfacesimplehtmldomnodeinterfacenull">childNodes</a>
     46</td><td><a href="#delete-mixed">delete</a>
    4647</td><td><a href="#findstring-selector-intnull-idx-simplehtmldominterfacesimplehtmldominterfacesimplehtmldomnodeinterfacesimplehtmldominterface">find</a>
    4748</td><td><a href="#findmultistring-selector-simplehtmldominterfacesimplehtmldomnodeinterfacesimplehtmldominterface">findMulti</a>
    48 </td><td><a href="#findmultiorfalsestring-selector-falsesimplehtmldominterfacesimplehtmldomnodeinterfacesimplehtmldominterface">findMultiOrFalse</a>
    49 </td></tr><tr><td><a href="#findonestring-selector-simplehtmldominterface">findOne</a>
     49</td></tr><tr><td><a href="#findmultiorfalsestring-selector-falsesimplehtmldominterfacesimplehtmldomnodeinterfacesimplehtmldominterface">findMultiOrFalse</a>
     50</td><td><a href="#findonestring-selector-simplehtmldominterface">findOne</a>
    5051</td><td><a href="#findoneorfalsestring-selector-falsesimplehtmldominterface">findOneOrFalse</a>
    5152</td><td><a href="#firstchild-simplehtmldominterfacenull">firstChild</a>
    52 </td><td><a href="#getallattributes-stringnull">getAllAttributes</a>
    53 </td></tr><tr><td><a href="#getattributestring-name-string">getAttribute</a>
     53</td></tr><tr><td><a href="#getallattributes-stringnull">getAllAttributes</a>
     54</td><td><a href="#getattributestring-name-string">getAttribute</a>
    5455</td><td><a href="#getelementbyclassstring-class-simplehtmldominterfacesimplehtmldomnodeinterfacesimplehtmldominterface">getElementByClass</a>
    5556</td><td><a href="#getelementbyidstring-id-simplehtmldominterface">getElementById</a>
    56 </td><td><a href="#getelementbytagnamestring-name-simplehtmldominterface">getElementByTagName</a>
    57 </td></tr><tr><td><a href="#getelementsbyidstring-id-intnull-idx-simplehtmldominterfacesimplehtmldominterfacesimplehtmldomnodeinterfacesimplehtmldominterface">getElementsById</a>
     57</td></tr><tr><td><a href="#getelementbytagnamestring-name-simplehtmldominterface">getElementByTagName</a>
     58</td><td><a href="#getelementsbyidstring-id-intnull-idx-simplehtmldominterfacesimplehtmldominterfacesimplehtmldomnodeinterfacesimplehtmldominterface">getElementsById</a>
    5859</td><td><a href="#getelementsbytagnamestring-name-intnull-idx-simplehtmldominterfacesimplehtmldominterfacesimplehtmldomnodeinterfacesimplehtmldominterface">getElementsByTagName</a>
    5960</td><td><a href="#gethtmldomparser-htmldomparser">getHtmlDomParser</a>
    60 </td><td><a href="#getiterator-simplehtmldomnodeinterfacesimplehtmldominterface">getIterator</a>
    61 </td></tr><tr><td><a href="#getnode-domnode">getNode</a>
     61</td></tr><tr><td><a href="#getiterator-simplehtmldomnodeinterfacesimplehtmldominterface">getIterator</a>
     62</td><td><a href="#getnode-domnode">getNode</a>
     63</td><td><a href="#gettag-string">getTag</a>
    6264</td><td><a href="#hasattributestring-name-bool">hasAttribute</a>
    63 </td><td><a href="#htmlbool-multidecodenewhtmlentity-string">html</a>
     65</td></tr><tr><td><a href="#htmlbool-multidecodenewhtmlentity-string">html</a>
    6466</td><td><a href="#innerhtmlbool-multidecodenewhtmlentity-string">innerHtml</a>
    65 </td></tr><tr><td><a href="#innerxmlbool-multidecodenewhtmlentity-string">innerXml</a>
     67</td><td><a href="#innerxmlbool-multidecodenewhtmlentity-string">innerXml</a>
    6668</td><td><a href="#isremoved-bool">isRemoved</a>
    67 </td><td><a href="#lastchild-simplehtmldominterfacenull">lastChild</a>
     69</td></tr><tr><td><a href="#lastchild-simplehtmldominterfacenull">lastChild</a>
    6870</td><td><a href="#nextnonwhitespacesibling-simplehtmldominterfacenull">nextNonWhitespaceSibling</a>
    69 </td></tr><tr><td><a href="#nextsibling-simplehtmldominterfacenull">nextSibling</a>
     71</td><td><a href="#nextsibling-simplehtmldominterfacenull">nextSibling</a>
    7072</td><td><a href="#parentnode-simplehtmldominterface">parentNode</a>
     73</td></tr><tr><td><a href="#previousnonwhitespacesibling-simplehtmldominterfacenull">previousNonWhitespaceSibling</a>
    7174</td><td><a href="#previoussibling-simplehtmldominterfacenull">previousSibling</a>
    7275</td><td><a href="#removeattributestring-name-simplehtmldominterface">removeAttribute</a>
     76</td><td><a href="#removeattributes-simplehtmldominterface">removeAttributes</a>
    7377</td></tr><tr><td><a href="#setattributestring-name-stringnull-value-bool-strictemptyvaluecheck-simplehtmldominterface">setAttribute</a>
    7478</td><td><a href="#text-string">text</a>
     
    7882---
    7983
    80 ## find(string $selector, int|null $idx):
     84## find(string $selector, int|null $idx): mixed
    8185<a href="#voku-php-readme-class-methods">↑</a>
    8286Find list of nodes with a CSS selector.
     
    8791
    8892**Return:**
    89 - `TODO: __not_detected__`
    90 
    91 --------
    92 
    93 ## findMulti(string $selector):
     93- `mixed`
     94
     95--------
     96
     97## findMulti(string $selector): mixed
    9498<a href="#voku-php-readme-class-methods">↑</a>
    9599Find nodes with a CSS selector.
     
    99103
    100104**Return:**
    101 - `TODO: __not_detected__`
    102 
    103 --------
    104 
    105 ## findMultiOrFalse(string $selector):
     105- `mixed`
     106
     107--------
     108
     109## findMultiOrFalse(string $selector): mixed
    106110<a href="#voku-php-readme-class-methods">↑</a>
    107111Find nodes with a CSS selector or false, if no element is found.
     
    111115
    112116**Return:**
    113 - `TODO: __not_detected__`
    114 
    115 --------
    116 
    117 ## findOne(string $selector):
     117- `mixed`
     118
     119--------
     120
     121## findOne(string $selector): static
    118122<a href="#voku-php-readme-class-methods">↑</a>
    119123Find one node with a CSS selector.
     
    123127
    124128**Return:**
    125 - `TODO: __not_detected__`
    126 
    127 --------
    128 
    129 ## findOneOrFalse(string $selector):
     129- `static`
     130
     131--------
     132
     133## findOneOrFalse(string $selector): mixed
    130134<a href="#voku-php-readme-class-methods">↑</a>
    131135Find one node with a CSS selector or false, if no element is found.
     
    135139
    136140**Return:**
    137 - `TODO: __not_detected__`
     141- `mixed`
    138142
    139143--------
     
    164168--------
    165169
    166 ## getElementByClass(string $class):
     170## getElementByClass(string $class): mixed
    167171<a href="#voku-php-readme-class-methods">↑</a>
    168172Return elements by ".class".
     
    172176
    173177**Return:**
    174 - `TODO: __not_detected__`
    175 
    176 --------
    177 
    178 ## getElementById(string $id):
     178- `mixed`
     179
     180--------
     181
     182## getElementById(string $id): mixed
    179183<a href="#voku-php-readme-class-methods">↑</a>
    180184Return element by #id.
     
    184188
    185189**Return:**
    186 - `TODO: __not_detected__`
    187 
    188 --------
    189 
    190 ## getElementByTagName(string $name):
     190- `mixed`
     191
     192--------
     193
     194## getElementByTagName(string $name): mixed
    191195<a href="#voku-php-readme-class-methods">↑</a>
    192196Return element by tag name.
     
    196200
    197201**Return:**
    198 - `TODO: __not_detected__`
    199 
    200 --------
    201 
    202 ## getElementsById(string $id, int|null $idx):
     202- `mixed`
     203
     204--------
     205
     206## getElementsById(string $id, int|null $idx): mixed
    203207<a href="#voku-php-readme-class-methods">↑</a>
    204208Returns elements by "#id".
     
    209213
    210214**Return:**
    211 - `TODO: __not_detected__`
    212 
    213 --------
    214 
    215 ## getElementsByTagName(string $name, int|null $idx):
     215- `mixed`
     216
     217--------
     218
     219## getElementsByTagName(string $name, int|null $idx): mixed
    216220<a href="#voku-php-readme-class-methods">↑</a>
    217221Returns elements by tag name.
     
    222226
    223227**Return:**
    224 - `TODO: __not_detected__`
     228- `mixed`
    225229
    226230--------
     
    300304--------
    301305
    302 ## set_callback(callable $functionName):
     306## set_callback(callable $functionName): mixed
    303307<a href="#voku-php-readme-class-methods">↑</a>
    304308
     
    308312
    309313**Return:**
    310 - `TODO: __not_detected__`
     314- `mixed`
    311315
    312316--------
     
    474478--------
    475479
     480## delete(): mixed
     481<a href="#voku-php-readme-class-methods">↑</a>
     482Delete
     483
     484**Parameters:**
     485__nothing__
     486
     487**Return:**
     488- `mixed`
     489
     490--------
     491
    476492## find(string $selector, int|null $idx): SimpleHtmlDomInterface|\SimpleHtmlDomInterface[]|\SimpleHtmlDomNodeInterface<\SimpleHtmlDomInterface>
    477493<a href="#voku-php-readme-class-methods">↑</a>
     
    672688--------
    673689
     690## getTag(): string
     691<a href="#voku-php-readme-class-methods">↑</a>
     692Return the tag of node
     693
     694**Parameters:**
     695__nothing__
     696
     697**Return:**
     698- `string`
     699
     700--------
     701
    674702## hasAttribute(string $name): bool
    675703<a href="#voku-php-readme-class-methods">↑</a>
     
    748776## nextNonWhitespaceSibling(): SimpleHtmlDomInterface|null
    749777<a href="#voku-php-readme-class-methods">↑</a>
    750 Returns the next sibling of node and it will ignore whitespace elements.
     778Returns the next sibling of node, and it will ignore whitespace elements.
    751779
    752780**Parameters:**
     
    782810--------
    783811
     812## previousNonWhitespaceSibling(): SimpleHtmlDomInterface|null
     813<a href="#voku-php-readme-class-methods">↑</a>
     814Returns the previous sibling of node, and it will ignore whitespace elements.
     815
     816**Parameters:**
     817__nothing__
     818
     819**Return:**
     820- `\SimpleHtmlDomInterface|null`
     821
     822--------
     823
    784824## previousSibling(): SimpleHtmlDomInterface|null
    785825<a href="#voku-php-readme-class-methods">↑</a>
     
    800840**Parameters:**
    801841- `string $name <p>The name of the html-attribute.</p>`
     842
     843**Return:**
     844- `\SimpleHtmlDomInterface`
     845
     846--------
     847
     848## removeAttributes(): SimpleHtmlDomInterface
     849<a href="#voku-php-readme-class-methods">↑</a>
     850Remove all attributes
     851
     852**Parameters:**
     853__nothing__
    802854
    803855**Return:**
  • wp-html-mail/trunk/vendor/voku/simple_html_dom/composer.json

    r2800468 r3058117  
    11{
    2   "name": "voku/simple_html_dom",
    3   "description": "Simple HTML DOM package.",
    4   "keywords": [
    5     "dom",
    6     "php dom",
    7     "HTML parser"
    8   ],
    9   "homepage": "http://simplehtmldom.sourceforge.net/",
    10   "license": "MIT",
    11   "type": "library",
    12   "authors": [
    13     {
    14       "name": "dimabdc",
    15       "email": "[email protected]",
    16       "homepage": "http://github.com/dimabdc",
    17       "role": "Developer"
     2    "name": "voku/simple_html_dom",
     3    "description": "Simple HTML DOM package.",
     4    "keywords": [
     5        "dom",
     6        "php dom",
     7        "HTML parser"
     8    ],
     9    "homepage": "https://github.com/voku/simple_html_dom",
     10    "license": "MIT",
     11    "type": "library",
     12    "authors": [
     13        {
     14            "name": "dimabdc",
     15            "email": "[email protected]",
     16            "homepage": "https://github.com/dimabdc",
     17            "role": "Developer"
     18        },
     19        {
     20            "name": "Lars Moelleken",
     21            "homepage": "https://www.moelleken.org/",
     22            "role": "Fork-Maintainer"
     23        }
     24    ],
     25    "require": {
     26        "php": ">=7.0.0",
     27        "ext-dom": "*",
     28        "ext-libxml": "*",
     29        "ext-simplexml": "*",
     30        "symfony/css-selector": "~3.0 || ~4.0 || ~5.0 || ~6.0"
    1831    },
    19     {
    20       "name": "Lars Moelleken",
    21       "homepage": "http://www.moelleken.org/",
    22       "role": "Developer"
     32    "suggest": {
     33        "voku/portable-utf8": "If you need e.g. UTF-8 fixed output."
     34    },
     35    "require-dev": {
     36        "phpunit/phpunit": "~6.0 || ~7.0 || ~9.0"
     37    },
     38    "autoload": {
     39        "psr-4": {
     40            "voku\\helper\\": "src/voku/helper/"
     41        }
     42    },
     43    "autoload-dev": {
     44        "psr-4": {
     45            "Tests\\": "tests"
     46        }
    2347    }
    24   ],
    25   "require": {
    26     "php": ">=7.0.0",
    27     "symfony/css-selector": "~3.0 || ~4.0 || ~5.0",
    28     "ext-dom": "*",
    29     "ext-libxml": "*",
    30     "ext-simplexml": "*"
    31   },
    32   "suggest": {
    33     "voku/portable-utf8": "If you need e.g. UTF-8 fixed output."
    34   },
    35   "require-dev": {
    36     "phpunit/phpunit": "~6.0 || ~7.0 || ~9.0"
    37   },
    38   "autoload": {
    39     "psr-4": {
    40       "voku\\helper\\": "src/voku/helper/"
    41     }
    42   },
    43   "autoload-dev": {
    44     "psr-4": {
    45       "Tests\\": "tests"
    46     }
    47   }
    4848}
  • wp-html-mail/trunk/vendor/voku/simple_html_dom/src/voku/helper/AbstractDomParser.php

    r2560935 r3058117  
    5858     * @var callable|null
    5959     *
    60      * @phpstan-var null|callable([\voku\helper\XmlDomParser|\voku\helper\HtmlDomParser]): void
     60     * @phpstan-var null|callable(\voku\helper\XmlDomParser|\voku\helper\HtmlDomParser): void
    6161     */
    6262    protected static $callback;
     
    109109        $this->document = clone $this->document;
    110110    }
    111 
    112     /** @noinspection MagicMethodsValidityInspection */
    113111
    114112    /**
     
    191189     * @param string   $selector
    192190     * @param int|null $idx
     191     *
     192     * @return mixed
    193193     */
    194194    abstract public function find(string $selector, $idx = null);
     
    198198     *
    199199     * @param string $selector
     200     *
     201     * @return mixed
    200202     */
    201203    abstract public function findMulti(string $selector);
     
    205207     *
    206208     * @param string $selector
     209     *
     210     * @return mixed
    207211     */
    208212    abstract public function findMultiOrFalse(string $selector);
     
    212216     *
    213217     * @param string $selector
     218     *
     219     * @return mixed
    214220     */
    215221    abstract public function findOne(string $selector);
     
    219225     *
    220226     * @param string $selector
     227     *
     228     * @return mixed
    221229     */
    222230    abstract public function findOneOrFalse(string $selector);
     
    234242     *
    235243     * @param bool $multiDecodeNewHtmlEntity
    236      *
    237      * @return string
    238      */
    239     abstract public function html(bool $multiDecodeNewHtmlEntity = false): string;
     244     * @param bool $putBrokenReplacedBack
     245     *
     246     * @return string
     247     */
     248    abstract public function html(bool $multiDecodeNewHtmlEntity = false, bool $putBrokenReplacedBack = true): string;
    240249
    241250    /**
     
    243252     *
    244253     * @param bool $multiDecodeNewHtmlEntity
    245      *
    246      * @return string
    247      */
    248     public function innerHtml(bool $multiDecodeNewHtmlEntity = false): string
     254     * @param bool $putBrokenReplacedBack
     255     *
     256     * @return string
     257     */
     258    public function innerHtml(bool $multiDecodeNewHtmlEntity = false, bool $putBrokenReplacedBack = true): string
    249259    {
    250260        // init
     
    257267        }
    258268
    259         return $this->fixHtmlOutput($text, $multiDecodeNewHtmlEntity);
     269        return $this->fixHtmlOutput($text, $multiDecodeNewHtmlEntity, $putBrokenReplacedBack);
    260270    }
    261271
     
    322332    /**
    323333     * @param callable $functionName
     334     *
     335     * @phpstan-param callable(\voku\helper\XmlDomParser|\voku\helper\HtmlDomParser): void $functionName
     336     *
     337     * @return void
    324338     */
    325339    public function set_callback($functionName)
     
    390404     *
    391405     * @param string $html
     406     *
     407     * @return void
    392408     */
    393409    protected function html5FallbackForScriptTags(string &$html)
     
    395411        // regEx for e.g.: [<script id="elements-image-2">...<script>]
    396412        /** @noinspection HtmlDeprecatedTag */
    397         $regExSpecialScript = '/<(script)(?<attr>[^>]*)>(?<content>.*)<\/\1>/isU';
     413        $regExSpecialScript = '/<script(?<attr>[^>]*?)>(?<content>.*)<\/script>/isU';
    398414        $htmlTmp = \preg_replace_callback(
    399415            $regExSpecialScript,
     
    418434     * @return string
    419435     */
    420     public static function putReplacedBackToPreserveHtmlEntities(string $html): string
     436    public static function putReplacedBackToPreserveHtmlEntities(string $html, bool $putBrokenReplacedBack = true): string
    421437    {
    422438        static $DOM_REPLACE__HELPER_CACHE = null;
     
    438454            $DOM_REPLACE__HELPER_CACHE['orig']['html_wrapper__end'] = '';
    439455
     456            $DOM_REPLACE__HELPER_CACHE['tmp']['html_wrapper__start_broken'] = self::$domHtmlWrapperHelper . '>';
     457            $DOM_REPLACE__HELPER_CACHE['tmp']['html_wrapper__end_broken'] = '</' . self::$domHtmlWrapperHelper;
     458
     459            $DOM_REPLACE__HELPER_CACHE['orig']['html_wrapper__start_broken'] = '';
     460            $DOM_REPLACE__HELPER_CACHE['orig']['html_wrapper__end_broken'] = '';
     461
    440462            $DOM_REPLACE__HELPER_CACHE['tmp']['html_special_script__start'] = '<' . self::$domHtmlSpecialScriptHelper;
    441463            $DOM_REPLACE__HELPER_CACHE['tmp']['html_special_script__end'] = '</' . self::$domHtmlSpecialScriptHelper . '>';
     
    443465            $DOM_REPLACE__HELPER_CACHE['orig']['html_special_script__start'] = '<script';
    444466            $DOM_REPLACE__HELPER_CACHE['orig']['html_special_script__end'] = '</script>';
     467
     468            $DOM_REPLACE__HELPER_CACHE['tmp']['html_special_script__start_broken'] = self::$domHtmlSpecialScriptHelper;
     469            $DOM_REPLACE__HELPER_CACHE['tmp']['html_special_script__end_broken'] = '</' . self::$domHtmlSpecialScriptHelper;
     470
     471            $DOM_REPLACE__HELPER_CACHE['orig']['html_special_script__start_broken'] = 'script';
     472            $DOM_REPLACE__HELPER_CACHE['orig']['html_special_script__end_broken'] = '</script';
    445473        }
    446474
    447475        if (
     476            $putBrokenReplacedBack === true
     477            &&
    448478            isset(self::$domBrokenReplaceHelper['tmp'])
    449479            &&
     
    470500
    471501            // regEx for e.g.: [https://www.domain.de/foo.php?foobar=1&email=lars%40moelleken.org&guid=test1233312&{{foo}}#foo]
    472             $regExUrl = '/(\[?\bhttps?:\/\/[^\s<>]+(?:\([\w]+\)|[^[:punct:]\s]|\/|\}|\]))/i';
     502            $regExUrl = '/(\[?\bhttps?:\/\/[^\s<>]+(?:\(\w+\)|[^[:punct:]\s]|\/|}|]))/i';
    473503            \preg_match_all($regExUrl, $html, $linksOld);
    474504
  • wp-html-mail/trunk/vendor/voku/simple_html_dom/src/voku/helper/AbstractSimpleHtmlDom.php

    r2560935 r3058117  
    2121        'innertext'    => 'innerHtml',
    2222        'innerhtml'    => 'innerHtml',
     23        'innerhtmlkeep'    => 'innerHtmlKeep',
    2324    ];
    2425
     
    7071            case 'innertext':
    7172                return $this->innerHtml();
     73            case 'innerhtmlkeep':
     74                return $this->innerHtml(false, false);
    7275            case 'text':
    7376            case 'plaintext':
    7477                return $this->text();
    7578            case 'tag':
    76                 return $this->node ? $this->node->nodeName : '';
     79                return $this->node->nodeName ?? '';
    7780            case 'attr':
    7881                return $this->getAllAttributes();
     
    122125            case 'innertext':
    123126            case 'innerhtml':
     127            case 'innerhtmlkeep':
    124128            case 'plaintext':
    125129            case 'text':
     
    153157            case 'innerhtml':
    154158                return $this->replaceChildWithString($value);
     159            case 'innerhtmlkeep':
     160                return $this->replaceChildWithString($value, false);
    155161            case 'plaintext':
    156162                return $this->replaceTextWithString($value);
     
    161167            default:
    162168                if ($this->node && \property_exists($this->node, $nameOrig)) {
     169                    // INFO: Cannot assign null to property DOMNode::* of type string
     170                    if ($nameOrig === 'prefix' || $nameOrig === 'textContent') {
     171                        $value = (string)$value;
     172                    }
     173
    163174                    return $this->node->{$nameOrig} = $value;
    164175                }
     
    206217    abstract public function html(bool $multiDecodeNewHtmlEntity = false): string;
    207218
    208     abstract public function innerHtml(bool $multiDecodeNewHtmlEntity = false): string;
     219    abstract public function innerHtml(bool $multiDecodeNewHtmlEntity = false, bool $putBrokenReplacedBack = true): string;
    209220
    210221    abstract public function removeAttribute(string $name): SimpleHtmlDomInterface;
    211222
    212     abstract protected function replaceChildWithString(string $string): SimpleHtmlDomInterface;
     223    abstract protected function replaceChildWithString(string $string, bool $putBrokenReplacedBack = true): SimpleHtmlDomInterface;
    213224
    214225    abstract protected function replaceNodeWithString(string $string): SimpleHtmlDomInterface;
  • wp-html-mail/trunk/vendor/voku/simple_html_dom/src/voku/helper/AbstractSimpleXmlDom.php

    r2560935 r3058117  
    5959                return $this->text();
    6060            case 'tag':
    61                 return $this->node ? $this->node->nodeName : '';
     61                return $this->node->nodeName ?? '';
    6262            case 'attr':
    6363                return $this->getAllAttributes();
     
    9797            case 'innertext':
    9898            case 'innerhtml':
     99            case 'innerhtmlkeep':
    99100            case 'plaintext':
    100101            case 'text':
     
    128129            case 'innerhtml':
    129130                return $this->replaceChildWithString($value);
     131            case 'innerhtmlkeep':
     132                return $this->replaceChildWithString($value, false);
    130133            case 'plaintext':
    131134                return $this->replaceTextWithString($value);
     
    189192    abstract public function removeAttribute(string $name): SimpleXmlDomInterface;
    190193
    191     abstract protected function replaceChildWithString(string $string): SimpleXmlDomInterface;
     194    abstract protected function replaceChildWithString(string $string, bool $putBrokenReplacedBack = true): SimpleXmlDomInterface;
    192195
    193196    abstract protected function replaceNodeWithString(string $string): SimpleXmlDomInterface;
  • wp-html-mail/trunk/vendor/voku/simple_html_dom/src/voku/helper/DomParserInterface.php

    r2259571 r3058117  
    1010     * @param string   $selector
    1111     * @param int|null $idx
     12     *
     13     * @return mixed
    1214     */
    1315    public function find(string $selector, $idx = null);
     
    1719     *
    1820     * @param string $selector
     21     *
     22     * @return mixed
    1923     */
    2024    public function findMulti(string $selector);
     
    2428     *
    2529     * @param string $selector
     30     *
     31     * @return mixed
    2632     */
    2733    public function findMultiOrFalse(string $selector);
     
    3137     *
    3238     * @param string $selector
     39     *
     40     * @return static
    3341     */
    3442    public function findOne(string $selector);
     
    3846     *
    3947     * @param string $selector
     48     *
     49     * @return mixed
    4050     */
    4151    public function findOneOrFalse(string $selector);
     
    4454     * @param string $content
    4555     * @param bool   $multiDecodeNewHtmlEntity
    46      *
    47      * @return string
    48      */
    49     public function fixHtmlOutput(string $content, bool $multiDecodeNewHtmlEntity = false): string;
     56     * @param bool   $putBrokenReplacedBack
     57     *
     58     * @return string
     59     */
     60    public function fixHtmlOutput(string $content, bool $multiDecodeNewHtmlEntity = false, bool $putBrokenReplacedBack = true): string;
    5061
    5162    /**
     
    5869     *
    5970     * @param string $class
     71     *
     72     * @return mixed
    6073     */
    6174    public function getElementByClass(string $class);
     
    6578     *
    6679     * @param string $id
     80     *
     81     * @return mixed
    6782     */
    6883    public function getElementById(string $id);
     
    7287     *
    7388     * @param string $name
     89     *
     90     * @return mixed
    7491     */
    7592    public function getElementByTagName(string $name);
     
    8097     * @param string   $id
    8198     * @param int|null $idx
     99     *
     100     * @return mixed
    82101     */
    83102    public function getElementsById(string $id, $idx = null);
     
    88107     * @param string   $name
    89108     * @param int|null $idx
     109     *
     110     * @return mixed
    90111     */
    91112    public function getElementsByTagName(string $name, $idx = null);
     
    95116     *
    96117     * @param bool $multiDecodeNewHtmlEntity
    97      *
    98      * @return string
    99      */
    100     public function html(bool $multiDecodeNewHtmlEntity = false): string;
     118     * @param bool $putBrokenReplacedBack
     119     *
     120     * @return string
     121     */
     122    public function html(bool $multiDecodeNewHtmlEntity = false, bool $putBrokenReplacedBack = true): string;
    101123
    102124    /**
     
    104126     *
    105127     * @param bool $multiDecodeNewHtmlEntity
    106      *
    107      * @return string
    108      */
    109     public function innerHtml(bool $multiDecodeNewHtmlEntity = false): string;
     128     * @param bool $putBrokenReplacedBack
     129     *
     130     * @return string
     131     */
     132    public function innerHtml(bool $multiDecodeNewHtmlEntity = false, bool $putBrokenReplacedBack = true): string;
    110133
    111134    /**
     
    151174    /**
    152175     * @param callable $functionName
     176     *
     177     * @return mixed
    153178     */
    154179    public function set_callback($functionName);
  • wp-html-mail/trunk/vendor/voku/simple_html_dom/src/voku/helper/HtmlDomParser.php

    r2560935 r3058117  
    149149     * @var bool
    150150     */
     151    protected $isDOMDocumentCreatedWithMultiRoot = false;
     152
     153    /**
     154     * @var bool
     155     */
    151156    protected $isDOMDocumentCreatedWithFakeEndScript = false;
    152157
     
    175180
    176181            if ($domNode instanceof \DOMNode) {
    177                 /** @noinspection UnusedFunctionResultInspection */
    178182                $this->document->appendChild($domNode);
    179183            }
     
    183187
    184188        if ($element !== null) {
    185             /** @noinspection UnusedFunctionResultInspection */
    186189            $this->loadHtml($element);
    187190        }
     
    212215     * @throws \RuntimeException
    213216     *
    214      * @return HtmlDomParser
     217     * @return static
    215218     */
    216219    public static function __callStatic($name, $arguments)
     
    253256            case 'innertext':
    254257                return $this->innerHtml();
     258            case 'innerhtmlkeep':
     259                return $this->innerHtml(false, false);
    255260            case 'text':
    256261            case 'plaintext':
     
    286291     * @param string   $html
    287292     * @param int|null $libXMLExtraOptions
     293     * @param bool     $useDefaultLibXMLOptions
    288294     *
    289295     * @return \DOMDocument
    290296     */
    291     protected function createDOMDocument(string $html, $libXMLExtraOptions = null): \DOMDocument
     297    protected function createDOMDocument(string $html, $libXMLExtraOptions = null, $useDefaultLibXMLOptions = true): \DOMDocument
    292298    {
    293299        if ($this->callbackBeforeCreateDom) {
     
    300306            $isDOMDocumentCreatedWithDoctype = true;
    301307            if (
    302                 \preg_match('/(^.*?)<!(?:DOCTYPE)(?: [^>]*)?>/sui', $html, $matches_before_doctype)
     308                \preg_match('/(^.*?)<!DOCTYPE(?: [^>]*)?>/sui', $html, $matches_before_doctype)
    303309                &&
    304310                \trim($matches_before_doctype[1])
     
    381387                if (\strpos($html, $tag) !== false) {
    382388                    $this->keepSpecialScriptTags($html);
     389                }
     390            }
     391        }
     392
     393        if (\strpos($html, '<svg') !== false) {
     394            $this->keepSpecialSvgTags($html);
     395        }
     396
     397        if (
     398            $this->isDOMDocumentCreatedWithoutHtmlWrapper
     399            &&
     400            $this->isDOMDocumentCreatedWithoutBodyWrapper
     401        ) {
     402            if (\substr_count($html, '</') >= 2) {
     403                $regexForMultiRootDetection = '#<(.*)>.*?</(\1)>#su';
     404                \preg_match($regexForMultiRootDetection, $html, $matches);
     405                if (($matches[0] ?? '') !== $html) {
     406                    $htmlTmp = \preg_replace($regexForMultiRootDetection, '', $html);
     407                    if ($htmlTmp !== null && trim($htmlTmp) === '') {
     408                        $this->isDOMDocumentCreatedWithMultiRoot = true;
     409                    }
    383410                }
    384411            }
     
    397424        // set error level
    398425        $internalErrors = \libxml_use_internal_errors(true);
    399         // if (\PHP_VERSION_ID < 80000) {
    400         //     $disableEntityLoader = \libxml_disable_entity_loader(true);
    401         // }
     426        if (\PHP_VERSION_ID < 80000) {
     427            $disableEntityLoader = \libxml_disable_entity_loader(true);
     428        }
    402429        \libxml_clear_errors();
    403430
    404         $optionsXml = \LIBXML_DTDLOAD | \LIBXML_DTDATTR | \LIBXML_NONET;
    405 
    406         if (\defined('LIBXML_BIGLINES')) {
    407             $optionsXml |= \LIBXML_BIGLINES;
    408         }
    409 
    410         if (\defined('LIBXML_COMPACT')) {
    411             $optionsXml |= \LIBXML_COMPACT;
    412         }
    413 
    414         if (\defined('LIBXML_HTML_NODEFDTD')) {
    415             $optionsXml |= \LIBXML_HTML_NODEFDTD;
     431        $optionsXml = 0;
     432        if ($useDefaultLibXMLOptions) {
     433            $optionsXml = \LIBXML_DTDLOAD | \LIBXML_DTDATTR | \LIBXML_NONET;
     434
     435            if (\defined('LIBXML_BIGLINES')) {
     436                $optionsXml |= \LIBXML_BIGLINES;
     437            }
     438
     439            if (\defined('LIBXML_COMPACT')) {
     440                $optionsXml |= \LIBXML_COMPACT;
     441            }
     442
     443            if (\defined('LIBXML_HTML_NODEFDTD')) {
     444                $optionsXml |= \LIBXML_HTML_NODEFDTD;
     445            }
    416446        }
    417447
     
    421451
    422452        if (
     453            $this->isDOMDocumentCreatedWithMultiRoot
     454            ||
    423455            $this->isDOMDocumentCreatedWithoutWrapper
    424456            ||
     
    440472        if ($sxe !== false && \count(\libxml_get_errors()) === 0) {
    441473            $domElementTmp = \dom_import_simplexml($sxe);
    442             if (
    443                 $domElementTmp
    444                 &&
    445                 $domElementTmp->ownerDocument
    446             ) {
     474            if ($domElementTmp->ownerDocument instanceof \DOMDocument) {
    447475                $documentFound = true;
    448476                $this->document = $domElementTmp->ownerDocument;
     
    454482            // UTF-8 hack: http://php.net/manual/en/domdocument.loadhtml.php#95251
    455483            $xmlHackUsed = false;
    456             /** @noinspection StringFragmentMisplacedInspection */
    457484            if (\stripos('<?xml', $html) !== 0) {
    458485                $xmlHackUsed = true;
     
    468495                foreach ($this->document->childNodes as $child) {
    469496                    if ($child->nodeType === \XML_PI_NODE) {
    470                         /** @noinspection UnusedFunctionResultInspection */
    471497                        $this->document->removeChild($child);
    472498
     
    483509        \libxml_clear_errors();
    484510        \libxml_use_internal_errors($internalErrors);
    485         // if (\PHP_VERSION_ID < 80000 && isset($disableEntityLoader)) {
    486         //     \libxml_disable_entity_loader($disableEntityLoader);
    487         // }
     511        if (\PHP_VERSION_ID < 80000 && isset($disableEntityLoader)) {
     512            \libxml_disable_entity_loader($disableEntityLoader);
     513        }
    488514
    489515        return $this->document;
     
    599625     * @param string $content
    600626     * @param bool   $multiDecodeNewHtmlEntity
     627     * @param bool   $putBrokenReplacedBack
    601628     *
    602629     * @return string
     
    604631    public function fixHtmlOutput(
    605632        string $content,
    606         bool $multiDecodeNewHtmlEntity = false
     633        bool $multiDecodeNewHtmlEntity = false,
     634        bool $putBrokenReplacedBack = true
    607635    ): string {
    608636        // INFO: DOMDocument will encapsulate plaintext into a e.g. paragraph tag (<p>),
     
    710738        $content = $this->decodeHtmlEntity($content, $multiDecodeNewHtmlEntity);
    711739
    712         return self::putReplacedBackToPreserveHtmlEntities($content);
     740        return self::putReplacedBackToPreserveHtmlEntities($content, $putBrokenReplacedBack);
    713741    }
    714742
     
    722750    public function getElementByClass(string $class): SimpleHtmlDomNodeInterface
    723751    {
    724         return $this->findMulti(".${class}");
     752        return $this->findMulti('.' . $class);
    725753    }
    726754
     
    734762    public function getElementById(string $id): SimpleHtmlDomInterface
    735763    {
    736         return $this->findOne("#${id}");
     764        return $this->findOne('#' . $id);
    737765    }
    738766
     
    765793    public function getElementsById(string $id, $idx = null)
    766794    {
    767         return $this->find("#${id}", $idx);
     795        return $this->find('#' . $id, $idx);
    768796    }
    769797
     
    808836     *
    809837     * @param bool $multiDecodeNewHtmlEntity
     838     * @param bool $putBrokenReplacedBack
    810839     *
    811840     * @return string
    812841     */
    813     public function html(bool $multiDecodeNewHtmlEntity = false): string
     842    public function html(bool $multiDecodeNewHtmlEntity = false, bool $putBrokenReplacedBack = true): string
    814843    {
    815844        if (static::$callback !== null) {
     
    827856        }
    828857
    829         return $this->fixHtmlOutput($content, $multiDecodeNewHtmlEntity);
     858        return $this->fixHtmlOutput($content, $multiDecodeNewHtmlEntity, $putBrokenReplacedBack);
    830859    }
    831860
     
    835864     * @param string   $html
    836865     * @param int|null $libXMLExtraOptions
    837      *
    838      * @return HtmlDomParser
    839      */
    840     public function loadHtml(string $html, $libXMLExtraOptions = null): DomParserInterface
    841     {
    842         // reset
    843         self::$domBrokenReplaceHelper = [];
    844 
    845         $this->document = $this->createDOMDocument($html, $libXMLExtraOptions);
     866     * @param bool     $useDefaultLibXMLOptions
     867     *
     868     * @return $this
     869     */
     870    public function loadHtml(string $html, $libXMLExtraOptions = null, $useDefaultLibXMLOptions = true): DomParserInterface
     871    {
     872        $this->document = $this->createDOMDocument($html, $libXMLExtraOptions, $useDefaultLibXMLOptions);
    846873
    847874        return $this;
     
    853880     * @param string   $filePath
    854881     * @param int|null $libXMLExtraOptions
     882     * @param bool     $useDefaultLibXMLOptions
    855883     *
    856884     * @throws \RuntimeException
    857885     *
    858      * @return HtmlDomParser
    859      */
    860     public function loadHtmlFile(string $filePath, $libXMLExtraOptions = null): DomParserInterface
    861     {
    862         // reset
    863         self::$domBrokenReplaceHelper = [];
    864 
     886     * @return $this
     887     */
     888    public function loadHtmlFile(string $filePath, $libXMLExtraOptions = null, $useDefaultLibXMLOptions = true): DomParserInterface
     889    {
    865890        if (
    866891            !\preg_match("/^https?:\/\//i", $filePath)
     
    868893            !\file_exists($filePath)
    869894        ) {
    870             throw new \RuntimeException("File ${filePath} not found");
     895            throw new \RuntimeException('File ' . $filePath . ' not found');
    871896        }
    872897
     
    878903            }
    879904        } catch (\Exception $e) {
    880             throw new \RuntimeException("Could not load file ${filePath}");
     905            throw new \RuntimeException('Could not load file ' . $filePath);
    881906        }
    882907
    883908        if ($html === false) {
    884             throw new \RuntimeException("Could not load file ${filePath}");
    885         }
    886 
    887         return $this->loadHtml($html, $libXMLExtraOptions);
     909            throw new \RuntimeException('Could not load file ' . $filePath);
     910        }
     911
     912        return $this->loadHtml($html, $libXMLExtraOptions, $useDefaultLibXMLOptions);
    888913    }
    889914
     
    965990    {
    966991        return $this->isDOMDocumentCreatedWithoutBodyWrapper;
     992    }
     993
     994    /**
     995     * @return bool
     996     */
     997    public function getIsDOMDocumentCreatedWithMultiRoot(): bool
     998    {
     999        return $this->isDOMDocumentCreatedWithMultiRoot;
    9671000    }
    9681001
     
    10181051
    10191052            $html = (string) \preg_replace_callback(
    1020                 '/(?<start>[^<]*)?(?<broken>(?:(?:<\/\w+(?:\s+\w+=\\"[^\"]+\\")*+)(?:[^<]+)>)+)(?<end>.*)/u',
     1053                '/(?<start>[^<]*)?(?<broken>(?:<\/\w+(?:\s+\w+=\"[^"]+\")*+[^<]+>)+)(?<end>.*)/u',
    10211054                static function ($matches) {
    10221055                    $matches['broken'] = \str_replace(
     
    10401073            $html
    10411074        );
     1075    }
     1076
     1077    /**
     1078     * workaround for bug: https://bugs.php.net/bug.php?id=74628
     1079     *
     1080     * @param string $html
     1081     *
     1082     * @return void
     1083     */
     1084    protected function keepSpecialSvgTags(string &$html)
     1085    {
     1086        // regEx for e.g.: [mask-image:url('data:image/svg+xml;utf8,<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">...</svg>')]
     1087        /** @noinspection HtmlDeprecatedTag */
     1088        $regExSpecialSvg = '/\((["\'])?(?<start>data:image\/svg.*)<svg(?<attr>[^>]*?)>(?<content>.*)<\/svg>\1\)/isU';
     1089        $htmlTmp = \preg_replace_callback(
     1090            $regExSpecialSvg,
     1091            static function ($svgs) {
     1092                if (empty($svgs['content'])) {
     1093                    return $svgs[0];
     1094                }
     1095
     1096                $content = '<svg' . $svgs['attr'] . '>' . $svgs['content'] . '</svg>';
     1097                self::$domBrokenReplaceHelper['orig'][] = $content;
     1098                self::$domBrokenReplaceHelper['tmp'][] = $matchesHash = self::$domHtmlBrokenHtmlHelper . \crc32($content);
     1099
     1100                return '(' . $svgs[1] . $svgs['start'] . $matchesHash . $svgs[1] . ')';
     1101            },
     1102            $html
     1103        );
     1104
     1105        if ($htmlTmp !== null) {
     1106            $html = $htmlTmp;
     1107        }
    10421108    }
    10431109
     
    10571123        ));
    10581124        $html = (string) \preg_replace_callback(
    1059             '/(?<start>((?:<script) [^>]*type=(?:["\'])?(?:' . $tags . ')+(?:[^>]*)>))(?<innerContent>.*)(?<end><\/script>)/isU',
     1125            '/(?<start>(<script [^>]*type=["\']?(?:' . $tags . ')+[^>]*>))(?<innerContent>.*)(?<end><\/script>)/isU',
    10601126            function ($matches) {
    10611127
    10621128                // Check for logic in special script tags, like [<% _.each(tierPrices, function(item, key) { %>],
    1063                 // because often this looks like non valid html in the template itself.
     1129                // because often this looks like non-valid html in the template itself.
    10641130                foreach ($this->templateLogicSyntaxInSpecialScriptTags as $logicSyntaxInSpecialScriptTag) {
    10651131                    if (\strpos($matches['innerContent'], $logicSyntaxInSpecialScriptTag) !== false) {
     
    10681134
    10691135                        self::$domBrokenReplaceHelper['orig'][] = $matches['innerContent'];
    1070                         self::$domBrokenReplaceHelper['tmp'][] = $matchesHash = '' . self::$domHtmlBrokenHtmlHelper . '' . \crc32($matches['innerContent']);
     1136                        self::$domBrokenReplaceHelper['tmp'][] = $matchesHash = self::$domHtmlBrokenHtmlHelper . \crc32($matches['innerContent']);
    10711137
    10721138                        return $matches['start'] . $matchesHash . $matches['end'];
     
    10881154     * @param bool $keepBrokenHtml
    10891155     *
    1090      * @return HtmlDomParser
     1156     * @return $this
    10911157     */
    10921158    public function useKeepBrokenHtml(bool $keepBrokenHtml): DomParserInterface
     
    11001166     * @param string[] $templateLogicSyntaxInSpecialScriptTags
    11011167     *
    1102      * @return HtmlDomParser
     1168     * @return $this
    11031169     */
    11041170    public function overwriteTemplateLogicSyntaxInSpecialScriptTags(array $templateLogicSyntaxInSpecialScriptTags): DomParserInterface
     
    11181184     * @param string[] $specialScriptTags
    11191185     *
    1120      * @return HtmlDomParser
     1186     * @return $this
    11211187     */
    11221188    public function overwriteSpecialScriptTags(array $specialScriptTags): DomParserInterface
     
    11371203     *
    11381204     * @phpstan-param callable(string $cssSelectorString, string $xPathString,\DOMXPath,\voku\helper\HtmlDomParser): string $callbackXPathBeforeQuery
    1139      */
    1140     public function setCallbackXPathBeforeQuery(callable $callbackXPathBeforeQuery)
     1205     *
     1206     * @return $this
     1207     */
     1208    public function setCallbackXPathBeforeQuery(callable $callbackXPathBeforeQuery): self
    11411209    {
    11421210        $this->callbackXPathBeforeQuery = $callbackXPathBeforeQuery;
     1211
     1212        return $this;
    11431213    }
    11441214
     
    11471217     *
    11481218     * @phpstan-param callable(string $htmlString, \voku\helper\HtmlDomParser): string $callbackBeforeCreateDom
    1149      */
    1150     public function setCallbackBeforeCreateDom(callable $callbackBeforeCreateDom)
     1219     *
     1220     * @return $this
     1221     */
     1222    public function setCallbackBeforeCreateDom(callable $callbackBeforeCreateDom): self
    11511223    {
    11521224        $this->callbackBeforeCreateDom = $callbackBeforeCreateDom;
     1225
     1226        return $this;
    11531227    }
    11541228}
  • wp-html-mail/trunk/vendor/voku/simple_html_dom/src/voku/helper/SelectorConverter.php

    r2560935 r3058117  
    2323     *                                      so that you can also use xPath selectors.
    2424     *                                      </p>
     25     * @param bool $isForHtml
    2526     *
    2627     * @return string
    2728     */
    28     public static function toXPath(string $selector, bool $ignoreCssSelectorErrors = false)
     29    public static function toXPath(string $selector, bool $ignoreCssSelectorErrors = false, bool $isForHtml = true)
    2930    {
    3031        if (isset(self::$compiled[$selector])) {
     
    5051        }
    5152
    52         $converter = new CssSelectorConverter(true);
     53        $converterKey = '-' . $isForHtml . '-' . $ignoreCssSelectorErrors . '-';
     54        static $converterArray = [];
     55        if (!isset($converterArray[$converterKey])) {
     56            $converterArray[$converterKey] = new CssSelectorConverter($isForHtml);
     57        }
     58        $converter = $converterArray[$converterKey];
     59        assert($converter instanceof CssSelectorConverter);
    5360
    5461        if ($ignoreCssSelectorErrors) {
  • wp-html-mail/trunk/vendor/voku/simple_html_dom/src/voku/helper/SimpleHtmlDom.php

    r2560935 r3058117  
    5454    }
    5555
     56    public function getTag(): string
     57    {
     58        return $this->tag;
     59    }
     60
    5661    /**
    5762     * Returns an array of attributes.
     
    135140     *
    136141     * @param bool $multiDecodeNewHtmlEntity
     142     * @param bool $putBrokenReplacedBack
    137143     *
    138144     * @return string
    139145     */
    140     public function innerHtml(bool $multiDecodeNewHtmlEntity = false): string
    141     {
    142         return $this->getHtmlDomParser()->innerHtml($multiDecodeNewHtmlEntity);
     146    public function innerHtml(bool $multiDecodeNewHtmlEntity = false, bool $putBrokenReplacedBack = true): string
     147    {
     148        return $this->getHtmlDomParser()->innerHtml($multiDecodeNewHtmlEntity, $putBrokenReplacedBack);
    143149    }
    144150
     
    160166
    161167    /**
     168     * Remove all attributes
     169     *
     170     * @return SimpleHtmlDomInterface
     171     */
     172    public function removeAttributes(): SimpleHtmlDomInterface
     173    {
     174        if ($this->hasAttributes()) {
     175            foreach (array_keys((array)$this->getAllAttributes()) as $attribute) {
     176                $this->removeAttribute($attribute);
     177            }
     178        }
     179        return $this;
     180    }
     181
     182    /**
    162183     * Replace child node.
    163184     *
    164185     * @param string $string
     186     * @param bool   $putBrokenReplacedBack
    165187     *
    166188     * @return SimpleHtmlDomInterface
    167189     */
    168     protected function replaceChildWithString(string $string): SimpleHtmlDomInterface
     190    protected function replaceChildWithString(string $string, bool $putBrokenReplacedBack = true): SimpleHtmlDomInterface
    169191    {
    170192        if (!empty($string)) {
    171193            $newDocument = new HtmlDomParser($string);
    172194
    173             $tmpDomString = $this->normalizeStringForComparision($newDocument);
    174             $tmpStr = $this->normalizeStringForComparision($string);
     195            $tmpDomString = $this->normalizeStringForComparison($newDocument);
     196            $tmpStr = $this->normalizeStringForComparison($string);
     197
    175198            if ($tmpDomString !== $tmpStr) {
    176199                throw new \RuntimeException(
     
    231254        $newDocument = new HtmlDomParser($string);
    232255
    233         $tmpDomOuterTextString = $this->normalizeStringForComparision($newDocument);
    234         $tmpStr = $this->normalizeStringForComparision($string);
     256        $tmpDomOuterTextString = $this->normalizeStringForComparison($newDocument);
     257        $tmpStr = $this->normalizeStringForComparison($string);
     258
    235259        if ($tmpDomOuterTextString !== $tmpStr) {
    236260            throw new \RuntimeException(
     
    361385     * @return \DOMElement|false
    362386     *                          <p>DOMElement a new instance of class DOMElement or false
    363      *                          if an error occured.</p>
     387     *                          if an error occurred.</p>
    364388     */
    365389    protected function changeElementName(\DOMNode $node, string $name)
     
    482506    public function getElementByClass(string $class): SimpleHtmlDomNodeInterface
    483507    {
    484         return $this->findMulti(".${class}");
     508        return $this->findMulti(".{$class}");
    485509    }
    486510
     
    494518    public function getElementById(string $id): SimpleHtmlDomInterface
    495519    {
    496         return $this->findOne("#${id}");
     520        return $this->findOne("#{$id}");
    497521    }
    498522
     
    529553    public function getElementsById(string $id, $idx = null)
    530554    {
    531         return $this->find("#${id}", $idx);
     555        return $this->find("#{$id}", $idx);
    532556    }
    533557
     
    677701        /** @var \DOMNode|null $node */
    678702        $node = $this->node->previousSibling;
     703
     704        if ($node === null) {
     705            return null;
     706        }
     707
     708        return new static($node);
     709    }
     710
     711    /**
     712     * Returns the previous sibling of node.
     713     *
     714     * @return SimpleHtmlDomInterface|null
     715     */
     716    public function previousNonWhitespaceSibling()
     717    {
     718        /** @var \DOMNode|null $node */
     719        $node = $this->node->previousSibling;
     720
     721        while ($node && !\trim($node->textContent)) {
     722            /** @var \DOMNode|null $node */
     723            $node = $node->previousSibling;
     724        }
    679725
    680726        if ($node === null) {
     
    908954
    909955    /**
    910      * Normalize the given input for comparision.
     956     * Normalize the given input for comparison.
    911957     *
    912958     * @param HtmlDomParser|string $input
     
    914960     * @return string
    915961     */
    916     private function normalizeStringForComparision($input): string
     962    private function normalizeStringForComparison($input): string
    917963    {
    918964        if ($input instanceof HtmlDomParser) {
    919             $string = $input->outerText();
     965            $string = $input->html(false, false);
    920966
    921967            if ($input->getIsDOMDocumentCreatedWithoutHeadWrapper()) {
     
    950996            );
    951997    }
     998
     999    /**
     1000     * Delete
     1001     *
     1002     * @return void
     1003     */
     1004    public function delete()
     1005    {
     1006        $this->outertext = '';
     1007    }
    9521008}
  • wp-html-mail/trunk/vendor/voku/simple_html_dom/src/voku/helper/SimpleHtmlDomBlank.php

    r2560935 r3058117  
    4646    }
    4747
     48    public function getTag(): string
     49    {
     50        return '';
     51    }
     52
    4853    /**
    4954     * Returns an array of attributes.
     
    104109     *
    105110     * @param bool $multiDecodeNewHtmlEntity
     111     * @param bool $putBrokenReplacedBack
    106112     *
    107113     * @return string
    108114     */
    109     public function innerHtml(bool $multiDecodeNewHtmlEntity = false): string
     115    public function innerHtml(bool $multiDecodeNewHtmlEntity = false, bool $putBrokenReplacedBack = true): string
    110116    {
    111117        return '';
     
    125131
    126132    /**
     133     * Remove all attributes
     134     *
     135     * @return SimpleHtmlDomBlank
     136     */
     137    public function removeAttributes(): SimpleHtmlDomInterface
     138    {
     139        return $this;
     140    }
     141
     142    /**
    127143     * @param string $string
    128      *
    129      * @return SimpleHtmlDomInterface
    130      */
    131     protected function replaceChildWithString(string $string): SimpleHtmlDomInterface
     144     * @param bool   $putBrokenReplacedBack
     145     *
     146     * @return SimpleHtmlDomInterface
     147     */
     148    protected function replaceChildWithString(string $string, bool $putBrokenReplacedBack = true): SimpleHtmlDomInterface
    132149    {
    133150        return new static();
     
    374391
    375392    /**
     393     * Returns the previous sibling of node.
     394     *
     395     * @return null
     396     */
     397    public function previousNonWhitespaceSibling()
     398    {
     399        return null;
     400    }
     401
     402    /**
    376403     * Returns the parent of node.
    377404     *
     
    433460        return '';
    434461    }
     462
     463    /**
     464     * Delete
     465     *
     466     * @return void
     467     */
     468    public function delete()
     469    {
     470        $this->outertext='';
     471    }
    435472}
  • wp-html-mail/trunk/vendor/voku/simple_html_dom/src/voku/helper/SimpleHtmlDomInterface.php

    r2560935 r3058117  
    1212 * @property string      $innerhtml
    1313 *                            <p>Get dom node's inner html.</p>
     14 * @property string      $innerhtmlKeep
     15 *                            <p>Get dom node's inner html + keep fix for broken html.</p>
    1416 * @property string      $plaintext
    1517 *                            <p>Get dom node's plain text.</p>
     
    9092
    9193    /**
     94     * Return the tag of node
     95     *
     96     * @return string
     97     */
     98    public function getTag():string;
     99
     100    /**
    92101     * Returns children of node.
    93102     *
     
    261270     *
    262271     * @param bool $multiDecodeNewHtmlEntity
    263      *
    264      * @return string
    265      */
    266     public function innerHtml(bool $multiDecodeNewHtmlEntity = false): string;
     272     * @param bool $putBrokenReplacedBack
     273     *
     274     * @return string
     275     */
     276    public function innerHtml(bool $multiDecodeNewHtmlEntity = false, bool $putBrokenReplacedBack = true): string;
    267277
    268278    /**
     
    299309
    300310    /**
    301      * Returns the next sibling of node and it will ignore whitespace elements.
     311     * Returns the next sibling of node, and it will ignore whitespace elements.
    302312     *
    303313     * @return SimpleHtmlDomInterface|null
    304314     */
    305315    public function nextNonWhitespaceSibling();
     316
     317    /**
     318     * Returns the previous sibling of node, and it will ignore whitespace elements.
     319     *
     320     * @return SimpleHtmlDomInterface|null
     321     */
     322    public function previousNonWhitespaceSibling();
    306323
    307324    /**
     
    343360
    344361    /**
     362     * Remove all attributes
     363     *
     364     * @return SimpleHtmlDomInterface
     365     */
     366    public function removeAttributes(): self;
     367
     368    /**
    345369     * Get dom node's plain text.
    346370     *
     
    358382     */
    359383    public function val($value = null);
     384
     385    /**
     386     * Delete
     387     *
     388     * @return mixed
     389     */
     390    public function delete();
    360391}
  • wp-html-mail/trunk/vendor/voku/simple_html_dom/src/voku/helper/SimpleHtmlDomNode.php

    r2560935 r3058117  
    8383     * @param string $selector
    8484     *
    85      * @return SimpleHtmlDomNodeInterface<SimpleHtmlDomInterface>|null
     85     * @return SimpleHtmlDomNodeInterface<SimpleHtmlDomInterface>
    8686     */
    8787    public function findOne(string $selector)
    8888    {
    89         return $this->find($selector, 0);
     89        $return = $this->find($selector, 0);
     90
     91        return $return ?? new SimpleHtmlDomNodeBlank();
    9092    }
    9193
     
    101103        $return = $this->find($selector, 0);
    102104
    103         if ($return === null) {
    104             return false;
    105         }
    106 
    107         return $return;
     105        return $return ?? false;
    108106    }
    109107
  • wp-html-mail/trunk/vendor/voku/simple_html_dom/src/voku/helper/SimpleHtmlDomNodeBlank.php

    r2259571 r3058117  
    5050     * @param string $selector
    5151     *
    52      * @return null
     52     * @return SimpleHtmlDomInterface
    5353     */
    5454    public function findOne(string $selector)
    5555    {
    56         return null;
     56        return new SimpleHtmlDomBlank();
    5757    }
    5858
  • wp-html-mail/trunk/vendor/voku/simple_html_dom/src/voku/helper/SimpleHtmlDomNodeInterface.php

    r2560935 r3058117  
    7575     * @param string $selector
    7676     *
    77      * @return SimpleHtmlDomNode|null
     77     * @return SimpleHtmlDomNodeInterface
    7878     */
    7979    public function findOne(string $selector);
     
    8484     * @param string $selector
    8585     *
    86      * @return false|SimpleHtmlDomNode
     86     * @return false|SimpleHtmlDomNodeInterface
    8787     */
    8888    public function findOneOrFalse(string $selector);
  • wp-html-mail/trunk/vendor/voku/simple_html_dom/src/voku/helper/SimpleXmlDom.php

    r2560935 r3058117  
    151151     *
    152152     * @param string $string
     153     * @param bool   $putBrokenReplacedBack
    153154     *
    154155     * @return SimpleXmlDomInterface
    155156     */
    156     protected function replaceChildWithString(string $string): SimpleXmlDomInterface
     157    protected function replaceChildWithString(string $string, bool $putBrokenReplacedBack = true): SimpleXmlDomInterface
    157158    {
    158159        if (!empty($string)) {
     
    161162            $tmpDomString = $this->normalizeStringForComparision($newDocument);
    162163            $tmpStr = $this->normalizeStringForComparision($string);
     164
    163165            if ($tmpDomString !== $tmpStr) {
    164166                throw new \RuntimeException(
     
    220222        $tmpDomOuterTextString = $this->normalizeStringForComparision($newDocument);
    221223        $tmpStr = $this->normalizeStringForComparision($string);
     224
    222225        if ($tmpDomOuterTextString !== $tmpStr) {
    223226            throw new \RuntimeException(
     
    453456    public function getElementByClass(string $class): SimpleXmlDomNodeInterface
    454457    {
    455         return $this->findMulti(".${class}");
     458        return $this->findMulti(".{$class}");
    456459    }
    457460
     
    465468    public function getElementById(string $id): SimpleXmlDomInterface
    466469    {
    467         return $this->findOne("#${id}");
     470        return $this->findOne("#{$id}");
    468471    }
    469472
     
    500503    public function getElementsById(string $id, $idx = null)
    501504    {
    502         return $this->find("#${id}", $idx);
     505        return $this->find("#{$id}", $idx);
    503506    }
    504507
     
    565568     *
    566569     * @param bool $multiDecodeNewHtmlEntity
     570     * @param bool $putBrokenReplacedBack
    567571     *
    568572     * @return string
    569573     */
    570     public function innerHtml(bool $multiDecodeNewHtmlEntity = false): string
    571     {
    572         return $this->getXmlDomParser()->innerHtml($multiDecodeNewHtmlEntity);
     574    public function innerHtml(bool $multiDecodeNewHtmlEntity = false, bool $putBrokenReplacedBack = true): string
     575    {
     576        return $this->getXmlDomParser()->innerHtml($multiDecodeNewHtmlEntity, $putBrokenReplacedBack);
    573577    }
    574578
     
    660664        /** @var \DOMNode|null $node */
    661665        $node = $this->node->previousSibling;
     666
     667        if ($node === null) {
     668            return null;
     669        }
     670
     671        return new static($node);
     672    }
     673
     674    /**
     675     * Returns the previous sibling of node.
     676     *
     677     * @return SimpleXmlDomInterface|null
     678     */
     679    public function previousNonWhitespaceSibling()
     680    {
     681        /** @var \DOMNode|null $node */
     682        $node = $this->node->previousSibling;
     683
     684        while ($node && !\trim($node->textContent)) {
     685            /** @var \DOMNode|null $node */
     686            $node = $node->previousSibling;
     687        }
    662688
    663689        if ($node === null) {
     
    787813    {
    788814        if ($input instanceof XmlDomParser) {
    789             $string = $input->plaintext;
     815            $string = $input->html(false, false);
    790816        } else {
    791817            $string = (string) $input;
  • wp-html-mail/trunk/vendor/voku/simple_html_dom/src/voku/helper/SimpleXmlDomBlank.php

    r2560935 r3058117  
    114114    /**
    115115     * @param string $string
    116      *
    117      * @return SimpleXmlDomInterface
    118      */
    119     protected function replaceChildWithString(string $string): SimpleXmlDomInterface
     116     * @param bool   $putBrokenReplacedBack
     117     *
     118     * @return SimpleXmlDomInterface
     119     */
     120    protected function replaceChildWithString(string $string, bool $putBrokenReplacedBack = true): SimpleXmlDomInterface
    120121    {
    121122        return new static();
     
    335336     *
    336337     * @param bool $multiDecodeNewHtmlEntity
     338     * @param bool $putBrokenReplacedBack
    337339     *
    338340     * @return string
    339341     */
    340     public function innerHtml(bool $multiDecodeNewHtmlEntity = false): string
     342    public function innerHtml(bool $multiDecodeNewHtmlEntity = false, bool $putBrokenReplacedBack = true): string
    341343    {
    342344        return '';
     
    401403     */
    402404    public function previousSibling()
     405    {
     406        return null;
     407    }
     408
     409    /**
     410     * Returns the previous sibling of node.
     411     *
     412     * @return null
     413     */
     414    public function previousNonWhitespaceSibling()
    403415    {
    404416        return null;
  • wp-html-mail/trunk/vendor/voku/simple_html_dom/src/voku/helper/SimpleXmlDomInterface.php

    r2560935 r3058117  
    251251     *
    252252     * @param bool $multiDecodeNewHtmlEntity
    253      *
    254      * @return string
    255      */
    256     public function innerHtml(bool $multiDecodeNewHtmlEntity = false): string;
     253     * @param bool $putBrokenReplacedBack
     254     *
     255     * @return string
     256     */
     257    public function innerHtml(bool $multiDecodeNewHtmlEntity = false, bool $putBrokenReplacedBack = true): string;
    257258
    258259    /**
     
    308309     */
    309310    public function previousSibling();
     311
     312    /**
     313     * Returns the previous sibling of node.
     314     *
     315     * @return SimpleXmlDomInterface|null
     316     */
     317    public function previousNonWhitespaceSibling();
    310318
    311319    /**
  • wp-html-mail/trunk/vendor/voku/simple_html_dom/src/voku/helper/SimpleXmlDomNode.php

    r2560935 r3058117  
    8383     * @param string $selector
    8484     *
    85      * @return SimpleXmlDomNodeInterface<SimpleXmlDomInterface>|null
     85     * @return SimpleXmlDomNodeInterface<SimpleXmlDomInterface>
    8686     */
    8787    public function findOne(string $selector)
    8888    {
    89         return $this->find($selector, 0);
     89        $return = $this->find($selector, 0);
     90
     91        return $return ?? new SimpleXmlDomNodeBlank();
    9092    }
    9193
     
    101103        $return = $this->find($selector, 0);
    102104
    103         /** @noinspection NullCoalescingOperatorCanBeUsedInspection */
    104         if ($return === null) {
    105             return false;
    106         }
    107 
    108         return $return;
     105        return $return ?? false;
    109106    }
    110107
  • wp-html-mail/trunk/vendor/voku/simple_html_dom/src/voku/helper/SimpleXmlDomNodeBlank.php

    r2560935 r3058117  
    5050     * @param string $selector
    5151     *
    52      * @return null
     52     * @return SimpleXmlDomInterface
    5353     */
    5454    public function findOne(string $selector)
    5555    {
    56         return null;
     56        return new SimpleXmlDomBlank();
    5757    }
    5858
  • wp-html-mail/trunk/vendor/voku/simple_html_dom/src/voku/helper/SimpleXmlDomNodeInterface.php

    r2560935 r3058117  
    7575     * @param string $selector
    7676     *
    77      * @return SimpleXmlDomNode|null
     77     * @return SimpleXmlDomInterface
    7878     */
    7979    public function findOne(string $selector);
     
    8484     * @param string $selector
    8585     *
    86      * @return false|SimpleXmlDomNode
     86     * @return false|SimpleXmlDomInterface
    8787     */
    8888    public function findOneOrFalse(string $selector);
  • wp-html-mail/trunk/vendor/voku/simple_html_dom/src/voku/helper/XmlDomParser.php

    r2560935 r3058117  
    9090     * @throws \RuntimeException
    9191     *
    92      * @return XmlDomParser
     92     * @return static
    9393     */
    9494    public static function __callStatic($name, $arguments)
     
    144144     * @param string   $xml
    145145     * @param int|null $libXMLExtraOptions
     146     * @param bool     $useDefaultLibXMLOptions
    146147     *
    147148     * @return \DOMDocument
    148149     */
    149     protected function createDOMDocument(string $xml, $libXMLExtraOptions = null): \DOMDocument
     150    protected function createDOMDocument(string $xml, $libXMLExtraOptions = null, $useDefaultLibXMLOptions = true): \DOMDocument
    150151    {
    151152        if ($this->callbackBeforeCreateDom) {
     
    155156        // set error level
    156157        $internalErrors = \libxml_use_internal_errors(true);
    157         // if (\PHP_VERSION_ID < 80000) {
    158         //     $disableEntityLoader = \libxml_disable_entity_loader(true);
    159         // }
     158        if (\PHP_VERSION_ID < 80000) {
     159            $disableEntityLoader = \libxml_disable_entity_loader(true);
     160        }
    160161        \libxml_clear_errors();
    161162
    162         $optionsXml = \LIBXML_DTDLOAD | \LIBXML_DTDATTR | \LIBXML_NONET;
    163 
    164         if (\defined('LIBXML_BIGLINES')) {
    165             $optionsXml |= \LIBXML_BIGLINES;
    166         }
    167 
    168         if (\defined('LIBXML_COMPACT')) {
    169             $optionsXml |= \LIBXML_COMPACT;
     163        $optionsXml = 0;
     164        if ($useDefaultLibXMLOptions) {
     165            $optionsXml = \LIBXML_DTDLOAD | \LIBXML_DTDATTR | \LIBXML_NONET;
     166
     167            if (\defined('LIBXML_BIGLINES')) {
     168                $optionsXml |= \LIBXML_BIGLINES;
     169            }
     170
     171            if (\defined('LIBXML_COMPACT')) {
     172                $optionsXml |= \LIBXML_COMPACT;
     173            }
    170174        }
    171175
     
    194198        if ($sxe !== false && \count($xmlErrors) === 0) {
    195199            $domElementTmp = \dom_import_simplexml($sxe);
    196             if (
    197                 $domElementTmp
    198                 &&
    199                 $domElementTmp->ownerDocument instanceof \DOMDocument
    200             ) {
     200            if ($domElementTmp->ownerDocument instanceof \DOMDocument) {
    201201                $documentFound = true;
    202202                $this->document = $domElementTmp->ownerDocument;
     
    249249        \libxml_clear_errors();
    250250        \libxml_use_internal_errors($internalErrors);
    251         // if (\PHP_VERSION_ID < 80000 && isset($disableEntityLoader)) {
    252         //     \libxml_disable_entity_loader($disableEntityLoader);
    253         // }
     251        if (\PHP_VERSION_ID < 80000 && isset($disableEntityLoader)) {
     252            \libxml_disable_entity_loader($disableEntityLoader);
     253        }
    254254
    255255        return $this->document;
     
    266266    public function find(string $selector, $idx = null)
    267267    {
    268         $xPathQuery = SelectorConverter::toXPath($selector, true);
     268        $xPathQuery = SelectorConverter::toXPath($selector, true, false);
    269269
    270270        $xPath = new \DOMXPath($this->document);
     
    371371     * @param string $content
    372372     * @param bool   $multiDecodeNewHtmlEntity
     373     * @param bool   $putBrokenReplacedBack
    373374     *
    374375     * @return string
    375376     */
    376     public function fixHtmlOutput(string $content, bool $multiDecodeNewHtmlEntity = false): string
    377     {
     377    public function fixHtmlOutput(
     378        string $content,
     379        bool $multiDecodeNewHtmlEntity = false,
     380        bool $putBrokenReplacedBack = true
     381    ): string {
    378382        $content = $this->decodeHtmlEntity($content, $multiDecodeNewHtmlEntity);
    379383
    380         return self::putReplacedBackToPreserveHtmlEntities($content);
     384        return self::putReplacedBackToPreserveHtmlEntities($content, $putBrokenReplacedBack);
    381385    }
    382386
     
    390394    public function getElementByClass(string $class): SimpleXmlDomNodeInterface
    391395    {
    392         return $this->findMulti(".${class}");
     396        return $this->findMulti(".{$class}");
    393397    }
    394398
     
    402406    public function getElementById(string $id): SimpleXmlDomInterface
    403407    {
    404         return $this->findOne("#${id}");
     408        return $this->findOne("#{$id}");
    405409    }
    406410
     
    433437    public function getElementsById(string $id, $idx = null)
    434438    {
    435         return $this->find("#${id}", $idx);
     439        return $this->find("#{$id}", $idx);
    436440    }
    437441
     
    476480     *
    477481     * @param bool $multiDecodeNewHtmlEntity
     482     * @param bool $putBrokenReplacedBack
    478483     *
    479484     * @return string
    480485     */
    481     public function html(bool $multiDecodeNewHtmlEntity = false): string
     486    public function html(bool $multiDecodeNewHtmlEntity = false, bool $putBrokenReplacedBack = true): string
    482487    {
    483488        if (static::$callback !== null) {
     
    491496        }
    492497
    493         return $this->fixHtmlOutput($content, $multiDecodeNewHtmlEntity);
     498        return $this->fixHtmlOutput($content, $multiDecodeNewHtmlEntity, $putBrokenReplacedBack);
    494499    }
    495500
     
    500505     * @param int|null $libXMLExtraOptions
    501506     *
    502      * @return self
     507     * @return $this
    503508     */
    504509    public function loadHtml(string $html, $libXMLExtraOptions = null): DomParserInterface
     
    517522     * @throws \RuntimeException
    518523     *
    519      * @return XmlDomParser
     524     * @return $this
    520525     */
    521526    public function loadHtmlFile(string $filePath, $libXMLExtraOptions = null): DomParserInterface
     
    526531            !\file_exists($filePath)
    527532        ) {
    528             throw new \RuntimeException("File ${filePath} not found");
     533            throw new \RuntimeException("File {$filePath} not found");
    529534        }
    530535
     
    536541            }
    537542        } catch (\Exception $e) {
    538             throw new \RuntimeException("Could not load file ${filePath}");
     543            throw new \RuntimeException("Could not load file {$filePath}");
    539544        }
    540545
    541546        if ($html === false) {
    542             throw new \RuntimeException("Could not load file ${filePath}");
     547            throw new \RuntimeException("Could not load file {$filePath}");
    543548        }
    544549
     
    576581     * @param string   $xml
    577582     * @param int|null $libXMLExtraOptions
    578      *
    579      * @return XmlDomParser
    580      */
    581     public function loadXml(string $xml, $libXMLExtraOptions = null): self
    582     {
    583         $this->document = $this->createDOMDocument($xml, $libXMLExtraOptions);
     583     * @param bool     $useDefaultLibXMLOptions
     584     *
     585     * @return $this
     586     */
     587    public function loadXml(string $xml, $libXMLExtraOptions = null, $useDefaultLibXMLOptions = true): self
     588    {
     589        $this->document = $this->createDOMDocument($xml, $libXMLExtraOptions, $useDefaultLibXMLOptions);
    584590
    585591        return $this;
     
    591597     * @param string   $filePath
    592598     * @param int|null $libXMLExtraOptions
     599     * @param bool     $useDefaultLibXMLOptions
    593600     *
    594601     * @throws \RuntimeException
    595602     *
    596      * @return XmlDomParser
    597      */
    598     public function loadXmlFile(string $filePath, $libXMLExtraOptions = null): self
     603     * @return $this
     604     */
     605    public function loadXmlFile(string $filePath, $libXMLExtraOptions = null, $useDefaultLibXMLOptions = true): self
    599606    {
    600607        if (
     
    603610            !\file_exists($filePath)
    604611        ) {
    605             throw new \RuntimeException("File ${filePath} not found");
     612            throw new \RuntimeException("File {$filePath} not found");
    606613        }
    607614
     
    613620            }
    614621        } catch (\Exception $e) {
    615             throw new \RuntimeException("Could not load file ${filePath}");
     622            throw new \RuntimeException("Could not load file {$filePath}");
    616623        }
    617624
    618625        if ($xml === false) {
    619             throw new \RuntimeException("Could not load file ${filePath}");
    620         }
    621 
    622         return $this->loadXml($xml, $libXMLExtraOptions);
     626            throw new \RuntimeException("Could not load file {$filePath}");
     627        }
     628
     629        return $this->loadXml($xml, $libXMLExtraOptions, $useDefaultLibXMLOptions);
    623630    }
    624631
  • wp-html-mail/trunk/wp-html-mail.php

    r2973684 r3058117  
    44Plugin URI: https://codemiq.com/en/plugins/wp-html-mail-email-templates/
    55Description: Create your own professional email design for all your outgoing WordPress emails
    6 Version: 3.4.5
     6Version: 3.4.7
    77Text Domain: wp-html-mail
    88Domain Path: /translations
     
    1212*/
    1313
    14 /*  Copyright 2023 codemiq (email : [email protected]) */
     14/*  Copyright 2024 codemiq (email : [email protected]) */
    1515
    1616if (!defined('ABSPATH')) {
     
    4646}
    4747
    48 
    4948function haet_mail_php_update_notice()
    5049{
Note: See TracChangeset for help on using the changeset viewer.