Version Description
- Fixed errors.
Download this release
Release Info
Developer | Benbodhi |
Plugin | SVG Support |
Version | 2.5.4 |
Comparing to | |
See all releases |
Code changes from version 2.5.3 to 2.5.4
- functions/attachment.php +2 -2
- functions/mime-types.php +2 -2
- readme.txt +9 -1
- svg-support.php +10 -2
- uninstall.php +2 -2
functions/attachment.php
CHANGED
@@ -232,7 +232,7 @@ function bodhi_svgs_sanitize_svg( $file ){
|
|
232 |
|
233 |
$should_sanitize_svg = array();
|
234 |
|
235 |
-
$sanitize_on_upload_roles_array = $bodhi_svgs_options['sanitize_on_upload_roles'];
|
236 |
|
237 |
$user = wp_get_current_user();
|
238 |
|
@@ -326,4 +326,4 @@ function bodhi_svgs_dimension_fallback( $image, $attachment_id, $size, $icon ) {
|
|
326 |
return $image;
|
327 |
|
328 |
}
|
329 |
-
add_filter( 'wp_get_attachment_image_src', 'bodhi_svgs_dimension_fallback', 10, 4 );
|
232 |
|
233 |
$should_sanitize_svg = array();
|
234 |
|
235 |
+
$sanitize_on_upload_roles_array = (array) $bodhi_svgs_options['sanitize_on_upload_roles'];
|
236 |
|
237 |
$user = wp_get_current_user();
|
238 |
|
326 |
return $image;
|
327 |
|
328 |
}
|
329 |
+
add_filter( 'wp_get_attachment_image_src', 'bodhi_svgs_dimension_fallback', 10, 4 );
|
functions/mime-types.php
CHANGED
@@ -19,7 +19,7 @@ function bodhi_svgs_upload_mimes( $mimes = array() ) {
|
|
19 |
$allowed_roles_array = array();
|
20 |
$is_role_allowed = array();
|
21 |
|
22 |
-
$allowed_roles_array = $bodhi_svgs_options['restrict'];
|
23 |
|
24 |
$user = wp_get_current_user();
|
25 |
|
@@ -86,4 +86,4 @@ function bodhi_svgs_allow_svg_upload( $data, $file, $filename, $mimes ) {
|
|
86 |
];
|
87 |
|
88 |
}
|
89 |
-
add_filter( 'wp_check_filetype_and_ext', 'bodhi_svgs_allow_svg_upload', 10, 4 );
|
19 |
$allowed_roles_array = array();
|
20 |
$is_role_allowed = array();
|
21 |
|
22 |
+
$allowed_roles_array = (array) $bodhi_svgs_options['restrict'];
|
23 |
|
24 |
$user = wp_get_current_user();
|
25 |
|
86 |
];
|
87 |
|
88 |
}
|
89 |
+
add_filter( 'wp_check_filetype_and_ext', 'bodhi_svgs_allow_svg_upload', 10, 4 );
|
readme.txt
CHANGED
@@ -5,7 +5,7 @@ Tags: svg, vector, safesvg, safe svg, sanitization, sanitisation, sanitizer, san
|
|
5 |
Requires at least: 4.8
|
6 |
Tested up to: 6.1.1
|
7 |
Requires PHP: 7.2
|
8 |
-
Stable tag: 2.5.
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
@@ -161,6 +161,9 @@ You need to add the mime type for svg and svgz to: "MLA Settings > Media Library
|
|
161 |
|
162 |
== Changelog ==
|
163 |
|
|
|
|
|
|
|
164 |
= 2.5.3 =
|
165 |
* Fixed fatal php error.
|
166 |
|
@@ -386,6 +389,11 @@ You need to add the mime type for svg and svgz to: "MLA Settings > Media Library
|
|
386 |
|
387 |
|
388 |
== Upgrade Notice ==
|
|
|
|
|
|
|
|
|
|
|
389 |
Updating to 2.5+ Adds new features and addresses a number of earlier issues raised. Please take a backup before updating!
|
390 |
2.5.3 fixes fatal error in 2.5.2.
|
391 |
|
5 |
Requires at least: 4.8
|
6 |
Tested up to: 6.1.1
|
7 |
Requires PHP: 7.2
|
8 |
+
Stable tag: 2.5.4
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
161 |
|
162 |
== Changelog ==
|
163 |
|
164 |
+
= 2.5.4 =
|
165 |
+
* Fixed errors.
|
166 |
+
|
167 |
= 2.5.3 =
|
168 |
* Fixed fatal php error.
|
169 |
|
389 |
|
390 |
|
391 |
== Upgrade Notice ==
|
392 |
+
= 2.5.4 =
|
393 |
+
Updating to 2.5+ Adds new features and addresses a number of earlier issues raised. Please take a backup before updating!
|
394 |
+
2.5.4 fixes errors in the 2.5 series of updates.
|
395 |
+
|
396 |
+
= 2.5.3 =
|
397 |
Updating to 2.5+ Adds new features and addresses a number of earlier issues raised. Please take a backup before updating!
|
398 |
2.5.3 fixes fatal error in 2.5.2.
|
399 |
|
svg-support.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: SVG Support
|
4 |
Plugin URI: http://wordpress.org/plugins/svg-support/
|
5 |
Description: Upload SVG files to the Media Library and render SVG files inline for direct styling/animation of an SVG's internal elements using CSS/JS.
|
6 |
-
Version: 2.5.
|
7 |
Author: Benbodhi
|
8 |
Author URI: https://benbodhi.com
|
9 |
Text Domain: svg-support
|
@@ -94,6 +94,10 @@ if ( !isset($bodhi_svgs_options['restrict']) || $bodhi_svgs_options['restrict']
|
|
94 |
$bodhi_svgs_options['restrict'] = array('administrator');
|
95 |
update_option( 'bodhi_svgs_settings', $bodhi_svgs_options );
|
96 |
}
|
|
|
|
|
|
|
|
|
97 |
|
98 |
// For version >= 2.5. | By default turn on "Sanitize SVG while uploading" option
|
99 |
if ( !isset($bodhi_svgs_options['sanitize_svg']) ) {
|
@@ -105,4 +109,8 @@ if ( !isset($bodhi_svgs_options['sanitize_svg']) ) {
|
|
105 |
if ( !isset($bodhi_svgs_options['sanitize_on_upload_roles']) ) {
|
106 |
$bodhi_svgs_options['sanitize_on_upload_roles'] = array('administrator', 'editor');
|
107 |
update_option( 'bodhi_svgs_settings', $bodhi_svgs_options );
|
108 |
-
}
|
|
|
|
|
|
|
|
3 |
Plugin Name: SVG Support
|
4 |
Plugin URI: http://wordpress.org/plugins/svg-support/
|
5 |
Description: Upload SVG files to the Media Library and render SVG files inline for direct styling/animation of an SVG's internal elements using CSS/JS.
|
6 |
+
Version: 2.5.4
|
7 |
Author: Benbodhi
|
8 |
Author URI: https://benbodhi.com
|
9 |
Text Domain: svg-support
|
94 |
$bodhi_svgs_options['restrict'] = array('administrator');
|
95 |
update_option( 'bodhi_svgs_settings', $bodhi_svgs_options );
|
96 |
}
|
97 |
+
elseif (isset($bodhi_svgs_options['restrict']) && $bodhi_svgs_options['restrict'] == "none" ) {
|
98 |
+
$bodhi_svgs_options['restrict'] = array("none");
|
99 |
+
update_option( 'bodhi_svgs_settings', $bodhi_svgs_options );
|
100 |
+
}
|
101 |
|
102 |
// For version >= 2.5. | By default turn on "Sanitize SVG while uploading" option
|
103 |
if ( !isset($bodhi_svgs_options['sanitize_svg']) ) {
|
109 |
if ( !isset($bodhi_svgs_options['sanitize_on_upload_roles']) ) {
|
110 |
$bodhi_svgs_options['sanitize_on_upload_roles'] = array('administrator', 'editor');
|
111 |
update_option( 'bodhi_svgs_settings', $bodhi_svgs_options );
|
112 |
+
}
|
113 |
+
elseif ( isset($bodhi_svgs_options['sanitize_on_upload_roles']) && $bodhi_svgs_options['sanitize_on_upload_roles'] == "none") {
|
114 |
+
$bodhi_svgs_options['sanitize_on_upload_roles'] = array("none");
|
115 |
+
update_option( 'bodhi_svgs_settings', $bodhi_svgs_options );
|
116 |
+
}
|
uninstall.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
|
5 |
$bodhi_options_on_deletion = get_option( 'bodhi_svgs_settings' );
|
6 |
|
7 |
-
if ( $bodhi_options_on_deletion[ 'del_plugin_data' ] === 'on' ) {
|
8 |
delete_option( 'bodhi_svgs_plugin_version' );
|
9 |
delete_option( 'bodhi_svgs_settings' );
|
10 |
-
}
|
4 |
|
5 |
$bodhi_options_on_deletion = get_option( 'bodhi_svgs_settings' );
|
6 |
|
7 |
+
if ( isset($bodhi_options_on_deletion[ 'del_plugin_data' ]) && $bodhi_options_on_deletion[ 'del_plugin_data' ] === 'on' ) {
|
8 |
delete_option( 'bodhi_svgs_plugin_version' );
|
9 |
delete_option( 'bodhi_svgs_settings' );
|
10 |
+
}
|