Plugin Directory

Changeset 3354948


Ignore:
Timestamp:
09/02/2025 09:23:54 PM (7 months ago)
Author:
Benjamin_Zekavica
Message:

added 4.0 version

Location:
easy-svg
Files:
148 added
10 edited

Legend:

Unmodified
Added
Removed
  • easy-svg/trunk/composer.json

    r3265293 r3354948  
    1313    ],
    1414    "require": {
    15         "enshrined/svg-sanitize": "^0.21.0"
     15        "enshrined/svg-sanitize": "^0.22.0"
    1616    }
    1717}
  • easy-svg/trunk/composer.lock

    r3265293 r3354948  
    55        "This file is @generated automatically"
    66    ],
    7     "content-hash": "94ea64f5c2f73fb7a33ff877ce4aebd4",
     7    "content-hash": "f157a1ddb5f4e5dcf44b69f60f692e08",
    88    "packages": [
    99        {
    1010            "name": "enshrined/svg-sanitize",
    11             "version": "0.21.0",
     11            "version": "0.22.0",
    1212            "source": {
    1313                "type": "git",
    1414                "url": "https://github.com/darylldoyle/svg-sanitizer.git",
    15                 "reference": "5e477468fac5c5ce933dce53af3e8e4e58dcccc9"
     15                "reference": "0afa95ea74be155a7bcd6c6fb60c276c39984500"
    1616            },
    1717            "dist": {
    1818                "type": "zip",
    19                 "url": "https://api.github.com/repos/darylldoyle/svg-sanitizer/zipball/5e477468fac5c5ce933dce53af3e8e4e58dcccc9",
    20                 "reference": "5e477468fac5c5ce933dce53af3e8e4e58dcccc9",
     19                "url": "https://api.github.com/repos/darylldoyle/svg-sanitizer/zipball/0afa95ea74be155a7bcd6c6fb60c276c39984500",
     20                "reference": "0afa95ea74be155a7bcd6c6fb60c276c39984500",
    2121                "shasum": ""
    2222            },
     
    4848            "support": {
    4949                "issues": "https://github.com/darylldoyle/svg-sanitizer/issues",
    50                 "source": "https://github.com/darylldoyle/svg-sanitizer/tree/0.21.0"
     50                "source": "https://github.com/darylldoyle/svg-sanitizer/tree/0.22.0"
    5151            },
    52             "time": "2025-01-13T09:32:25+00:00"
     52            "time": "2025-08-12T10:13:48+00:00"
    5353        }
    5454    ],
     
    5656    "aliases": [],
    5757    "minimum-stability": "stable",
    58     "stability-flags": [],
     58    "stability-flags": {},
    5959    "prefer-stable": false,
    6060    "prefer-lowest": false,
    61     "platform": [],
    62     "platform-dev": [],
     61    "platform": {},
     62    "platform-dev": {},
    6363    "plugin-api-version": "2.6.0"
    6464}
  • easy-svg/trunk/easy-svg.php

    r3265293 r3354948  
    44Plugin URI:  https://wordpress.org/plugins/easy-svg/
    55Description: Add SVG Support for WordPress.
    6 Version:     3.9
     6Version:     4.0
    77Author:      Benjamin Zekavica
    88Requires PHP: 8.0
  • easy-svg/trunk/readme.txt

    r3265293 r3354948  
    77Tested up to: 6.8
    88Requires PHP: 8.0
    9 Stable tag: 3.9
     9Stable tag: 4.0
    1010License: GPLv3
    1111License URI: http://www.gnu.org/licenses/gpl-3.0.txt
     
    8282
    8383== Changelog ==
     84= 4.0: September 2, 2025 =
     85* Support for new WordPress version
     86* Support Gutenberg Version
     87* Updated SVG Sanitizer Package
    8488
    8589= 3.9: 1st of April, 2025 =
  • easy-svg/trunk/vendor/autoload.php

    r3265293 r3354948  
    1515        }
    1616    }
    17     trigger_error(
    18         $err,
    19         E_USER_ERROR
    20     );
     17    throw new RuntimeException($err);
    2118}
    2219
  • easy-svg/trunk/vendor/composer/InstalledVersions.php

    r2928172 r3354948  
    2828{
    2929    /**
     30     * @var string|null if set (by reflection by Composer), this should be set to the path where this class is being copied to
     31     * @internal
     32     */
     33    private static $selfDir = null;
     34
     35    /**
    3036     * @var mixed[]|null
    3137     * @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}|array{}|null
    3238     */
    3339    private static $installed;
     40
     41    /**
     42     * @var bool
     43     */
     44    private static $installedIsLocalDir;
    3445
    3546    /**
     
    310321        self::$installed = $data;
    311322        self::$installedByVendor = array();
     323
     324        // when using reload, we disable the duplicate protection to ensure that self::$installed data is
     325        // always returned, but we cannot know whether it comes from the installed.php in __DIR__ or not,
     326        // so we have to assume it does not, and that may result in duplicate data being returned when listing
     327        // all installed packages for example
     328        self::$installedIsLocalDir = false;
     329    }
     330
     331    /**
     332     * @return string
     333     */
     334    private static function getSelfDir()
     335    {
     336        if (self::$selfDir === null) {
     337            self::$selfDir = strtr(__DIR__, '\\', '/');
     338        }
     339
     340        return self::$selfDir;
    312341    }
    313342
     
    323352
    324353        $installed = array();
     354        $copiedLocalDir = false;
    325355
    326356        if (self::$canGetVendors) {
     357            $selfDir = self::getSelfDir();
    327358            foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
     359                $vendorDir = strtr($vendorDir, '\\', '/');
    328360                if (isset(self::$installedByVendor[$vendorDir])) {
    329361                    $installed[] = self::$installedByVendor[$vendorDir];
     
    331363                    /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
    332364                    $required = require $vendorDir.'/composer/installed.php';
    333                     $installed[] = self::$installedByVendor[$vendorDir] = $required;
    334                     if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
    335                         self::$installed = $installed[count($installed) - 1];
     365                    self::$installedByVendor[$vendorDir] = $required;
     366                    $installed[] = $required;
     367                    if (self::$installed === null && $vendorDir.'/composer' === $selfDir) {
     368                        self::$installed = $required;
     369                        self::$installedIsLocalDir = true;
    336370                    }
     371                }
     372                if (self::$installedIsLocalDir && $vendorDir.'/composer' === $selfDir) {
     373                    $copiedLocalDir = true;
    337374                }
    338375            }
     
    351388        }
    352389
    353         if (self::$installed !== array()) {
     390        if (self::$installed !== array() && !$copiedLocalDir) {
    354391            $installed[] = self::$installed;
    355392        }
  • easy-svg/trunk/vendor/composer/installed.json

    r3265293 r3354948  
    33        {
    44            "name": "enshrined/svg-sanitize",
    5             "version": "0.21.0",
    6             "version_normalized": "0.21.0.0",
     5            "version": "0.22.0",
     6            "version_normalized": "0.22.0.0",
    77            "source": {
    88                "type": "git",
    99                "url": "https://github.com/darylldoyle/svg-sanitizer.git",
    10                 "reference": "5e477468fac5c5ce933dce53af3e8e4e58dcccc9"
     10                "reference": "0afa95ea74be155a7bcd6c6fb60c276c39984500"
    1111            },
    1212            "dist": {
    1313                "type": "zip",
    14                 "url": "https://api.github.com/repos/darylldoyle/svg-sanitizer/zipball/5e477468fac5c5ce933dce53af3e8e4e58dcccc9",
    15                 "reference": "5e477468fac5c5ce933dce53af3e8e4e58dcccc9",
     14                "url": "https://api.github.com/repos/darylldoyle/svg-sanitizer/zipball/0afa95ea74be155a7bcd6c6fb60c276c39984500",
     15                "reference": "0afa95ea74be155a7bcd6c6fb60c276c39984500",
    1616                "shasum": ""
    1717            },
     
    2424                "phpunit/phpunit": "^6.5 || ^8.5"
    2525            },
    26             "time": "2025-01-13T09:32:25+00:00",
     26            "time": "2025-08-12T10:13:48+00:00",
    2727            "type": "library",
    2828            "installation-source": "dist",
     
    4545            "support": {
    4646                "issues": "https://github.com/darylldoyle/svg-sanitizer/issues",
    47                 "source": "https://github.com/darylldoyle/svg-sanitizer/tree/0.21.0"
     47                "source": "https://github.com/darylldoyle/svg-sanitizer/tree/0.22.0"
    4848            },
    4949            "install-path": "../enshrined/svg-sanitize"
  • easy-svg/trunk/vendor/composer/installed.php

    r3265293 r3354948  
    44        'pretty_version' => 'dev-master',
    55        'version' => 'dev-master',
    6         'reference' => '55fa71f309dbb75ab6fb96cf66a69097335e9f95',
     6        'reference' => 'f2477c7744d8c44c69f347357b146b9adcc4dca7',
    77        'type' => 'library',
    88        'install_path' => __DIR__ . '/../../',
     
    1414            'pretty_version' => 'dev-master',
    1515            'version' => 'dev-master',
    16             'reference' => '55fa71f309dbb75ab6fb96cf66a69097335e9f95',
     16            'reference' => 'f2477c7744d8c44c69f347357b146b9adcc4dca7',
    1717            'type' => 'library',
    1818            'install_path' => __DIR__ . '/../../',
     
    2121        ),
    2222        'enshrined/svg-sanitize' => array(
    23             'pretty_version' => '0.21.0',
    24             'version' => '0.21.0.0',
    25             'reference' => '5e477468fac5c5ce933dce53af3e8e4e58dcccc9',
     23            'pretty_version' => '0.22.0',
     24            'version' => '0.22.0.0',
     25            'reference' => '0afa95ea74be155a7bcd6c6fb60c276c39984500',
    2626            'type' => 'library',
    2727            'install_path' => __DIR__ . '/../enshrined/svg-sanitize',
  • easy-svg/trunk/vendor/composer/platform_check.php

    r3181757 r3354948  
    2020        }
    2121    }
    22     trigger_error(
    23         'Composer detected issues in your platform: ' . implode(' ', $issues),
    24         E_USER_ERROR
     22    throw new \RuntimeException(
     23        'Composer detected issues in your platform: ' . implode(' ', $issues)
    2524    );
    2625}
  • easy-svg/trunk/vendor/enshrined/svg-sanitize/src/Sanitizer.php

    r3181757 r3354948  
    422422             * We have to do this as the link is still ran in this case.
    423423             */
    424             if (false !== strpos($attrName, 'href')) {
     424            if (false !== stripos($attrName, 'href')) {
    425425                $href = $element->getAttribute($attrName);
    426426                if (false === $this->isHrefSafeValue($href)) {
     
    454454    protected function cleanXlinkHrefs(\DOMElement $element)
    455455    {
    456         $xlinks = $element->getAttributeNS('http://www.w3.org/1999/xlink', 'href');
    457         if (false === $this->isHrefSafeValue($xlinks)) {
    458             $element->removeAttributeNS( 'http://www.w3.org/1999/xlink', 'href' );
    459             $this->xmlIssues[] = array(
    460                 'message' => 'Suspicious attribute \'href\'',
    461                 'line' => $element->getLineNo(),
    462             );
    463         }
     456        foreach ($element->attributes as $attribute) {
     457            // remove attributes with unexpected namespace prefix, e.g. `XLinK:href` (instead of `xlink:href`)
     458            if ($attribute->prefix === '' && strtolower($attribute->nodeName) === 'xlink:href') {
     459                $element->removeAttribute($attribute->nodeName);
     460                $this->xmlIssues[] = array(
     461                    'message' => sprintf('Unexpected attribute \'%s\'', $attribute->nodeName),
     462                    'line' => $element->getLineNo(),
     463                );
     464            }
     465        }
     466        $this->cleanHrefAttributes($element, 'xlink');
    464467    }
    465468
     
    471474    protected function cleanHrefs(\DOMElement $element)
    472475    {
    473         $href = $element->getAttribute('href');
    474         if (false === $this->isHrefSafeValue($href)) {
    475             $element->removeAttribute('href');
    476             $this->xmlIssues[] = array(
    477                 'message' => 'Suspicious attribute \'href\'',
    478                 'line' => $element->getLineNo(),
    479             );
     476        $this->cleanHrefAttributes($element);
     477    }
     478
     479    protected function cleanHrefAttributes(\DOMElement $element, string $prefix = ''): void
     480    {
     481        $relevantAttributes = array_filter(
     482            iterator_to_array($element->attributes),
     483            static function (\DOMAttr $attr) use ($prefix) {
     484                return strtolower($attr->name) === 'href' && strtolower($attr->prefix) === $prefix;
     485            }
     486        );
     487        foreach ($relevantAttributes as $attribute) {
     488            if (!$this->isHrefSafeValue($attribute->value)) {
     489                $element->removeAttribute($attribute->nodeName);
     490                $this->xmlIssues[] = array(
     491                    'message' => sprintf('Suspicious attribute \'%s\'', $attribute->nodeName),
     492                    'line' => $element->getLineNo(),
     493                );
     494                continue;
     495            }
     496            // in case the attribute name is `HrEf`/`xlink:HrEf`, adjust it to `href`/`xlink:href`
     497            if (!in_array($attribute->nodeName, $this->allowedAttrs, true)
     498                && in_array(strtolower($attribute->nodeName), $this->allowedAttrs, true)
     499            ) {
     500                $element->removeAttribute($attribute->nodeName);
     501                $element->setAttribute(strtolower($attribute->nodeName), $attribute->value);
     502            }
    480503        }
    481504    }
Note: See TracChangeset for help on using the changeset viewer.