Linux 软件免费装
Banner图

Safe SVG

开发者 enshrined
10up
jeffpaul
更新时间 2024年3月28日 21:41
PHP版本: 7.4 及以上
WordPress版本: 6.5
版权: GPLv2 or later
版权网址: 版权信息

标签

security image media upload file svg graphic sanitize vector mime svg upload sanitise

下载

1.0.0 2.2.0 2.2.3 1.3.4 1.3.1 1.3.2 1.3.3 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.5.0 1.5.1 1.5.2 1.5.3 1.6.1 1.7.1 1.8.0 1.8.1 1.9.0 1.9.1 1.9.2 1.9.3 1.9.4 1.9.5 1.9.7 1.9.8 1.9.9 1.9.6 2.1.0 2.2.1 2.2.2 1.1.1 2.0.3 1.2.0 1.1.0 1.6.0 2.0.0 2.0.1 2.0.2 1.3.0 1.9.10 2.1.1 2.2.4

详情介绍:

Safe SVG is the best way to Allow SVG Uploads in WordPress! It gives you the ability to allow SVG uploads whilst making sure that they're sanitized to stop SVG/XML vulnerabilities affecting your site. It also gives you the ability to preview your uploaded SVGs in the media library in all views. Current Features SVG Sanitization is done through the following library: https://github.com/darylldoyle/svg-sanitizer. SVG Optimization is done through the following library: https://github.com/svg/svgo.

安装:

Install through the WordPress directory or download, unzip and upload the files to your /wp-content/plugins/ directory

升级注意事项:

1.9.10
  • Important: bumped the WordPress minimum version from 4.0 to 4.7 and the PHP minimum version from 5.6 to 7.0.

常见问题:

Can we change the allowed attributes and tags?

Yes, this can be done using the svg_allowed_attributes and svg_allowed_tags filters. They take one argument that must be returned. See below for examples: add_filter( 'svg_allowed_attributes', function ( $attributes ) { // Do what you want here... // This should return an array so add your attributes to // to the $attributes array before returning it. E.G. $attributes[] = 'target'; // This would allow the target="" attribute. return $attributes; } ); add_filter( 'svg_allowed_tags', function ( $tags ) { // Do what you want here... // This should return an array so add your tags to // to the $tags array before returning it. E.G. $tags[] = 'use'; // This would allow the element. return $tags; } );

更新日志:

2.2.4 - 2024-03-28 2.2.3 - 2024-03-20 2.2.2 - 2023-11-21 2.2.1 - 2023-10-23 2.2.0 - 2023-08-21 2.1.1 - 2023-04-05 2.1.0 - 2023-03-22 Earlier versions For the changelog of earlier versions, please refer to the changelog on github.com.