SVG Support - Version 2.2.4

Version Description

  • FIX: Added function to temporarily fix an issue with uploading in WP 4.7.1
Download this release

Release Info

Developer Benbodhi
Plugin Icon 128x128 SVG Support
Version 2.2.4
Comparing to
See all releases

Code changes from version 2.2.3.2 to 2.2.4

Files changed (2) hide show
  1. readme.txt +11 -3
  2. svg-support.php +17 -2
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === SVG Support ===
2
  Contributors: Benbodhi
3
- Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=F7W2NUFAVQGW2
4
  Tags: svg, vector, css, style, mime, mime type, embed, img, inline
5
  Requires at least: 4.0
6
- Tested up to: 4.8-alpha-39677
7
- Stable tag: 2.2.3.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -110,6 +110,10 @@ I will put the answers to any questions asked here.
110
 
111
  == Changelog ==
112
 
 
 
 
 
113
  = 2.2.3.2 =
114
 
115
  * Changed text domain to match plugin slug for localization.
@@ -198,6 +202,10 @@ I will put the answers to any questions asked here.
198
 
199
  == Upgrade Notice ==
200
 
 
 
 
 
201
  = 2.2.3.2 =
202
 
203
  * Changed text domain to match plugin slug for localization.
1
  === SVG Support ===
2
  Contributors: Benbodhi
3
+ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=Z9R7JERS82EQQ
4
  Tags: svg, vector, css, style, mime, mime type, embed, img, inline
5
  Requires at least: 4.0
6
+ Tested up to: 4.8-alpha-39894
7
+ Stable tag: 2.2.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
110
 
111
  == Changelog ==
112
 
113
+ = 2.2.4 =
114
+
115
+ * FIX: Added function to temporarily fix an issue with uploading in WP 4.7.1
116
+
117
  = 2.2.3.2 =
118
 
119
  * Changed text domain to match plugin slug for localization.
202
 
203
  == Upgrade Notice ==
204
 
205
+ = 2.2.4 =
206
+
207
+ * IMPORTANT: Fixes upload ability in WP 4.7.1
208
+
209
  = 2.2.3.2 =
210
 
211
  * Changed text domain to match plugin slug for localization.
svg-support.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: SVG Support
4
  Plugin URI: http://wordpress.org/plugins/svg-support/
5
  Description: Allow SVG file uploads using the WordPress Media Library uploader plus direct styling of SVG elements using CSS.
6
- Version: 2.2.3.2
7
  Author: Benbodhi
8
  Author URI: http://benbodhi.com
9
  Text Domain: svg-support
@@ -35,7 +35,7 @@ if ( ! defined( 'ABSPATH' ) ) {
35
  /********************************************
36
  * GLOBAL VARIABLES
37
  ********************************************/
38
- $svgs_plugin_version = '2.2.3.2'; // for use on admin pages
39
  $plugin_file = plugin_basename(__FILE__); // plugin file for reference
40
  define( 'BODHI_SVGS_PLUGIN_PATH', plugin_dir_path( __FILE__ ) ); // define the absolute plugin path for includes
41
  $bodhi_svgs_options = get_option('bodhi_svgs_settings'); // retrieve our plugin settings from the options table
@@ -51,4 +51,19 @@ include( BODHI_SVGS_PLUGIN_PATH . 'functions/enqueue.php' ); // enqueue js &
51
  include( BODHI_SVGS_PLUGIN_PATH . 'functions/localization.php' ); // setup localization & languages
52
  include( BODHI_SVGS_PLUGIN_PATH . 'functions/attribute-control.php' ); // auto set SVG class & remove dimensions during insertion
53
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
54
  ?>
3
  Plugin Name: SVG Support
4
  Plugin URI: http://wordpress.org/plugins/svg-support/
5
  Description: Allow SVG file uploads using the WordPress Media Library uploader plus direct styling of SVG elements using CSS.
6
+ Version: 2.2.4
7
  Author: Benbodhi
8
  Author URI: http://benbodhi.com
9
  Text Domain: svg-support
35
  /********************************************
36
  * GLOBAL VARIABLES
37
  ********************************************/
38
+ $svgs_plugin_version = '2.2.4'; // for use on admin pages
39
  $plugin_file = plugin_basename(__FILE__); // plugin file for reference
40
  define( 'BODHI_SVGS_PLUGIN_PATH', plugin_dir_path( __FILE__ ) ); // define the absolute plugin path for includes
41
  $bodhi_svgs_options = get_option('bodhi_svgs_settings'); // retrieve our plugin settings from the options table
51
  include( BODHI_SVGS_PLUGIN_PATH . 'functions/localization.php' ); // setup localization & languages
52
  include( BODHI_SVGS_PLUGIN_PATH . 'functions/attribute-control.php' ); // auto set SVG class & remove dimensions during insertion
53
 
54
+ /**
55
+ * TEMP FIX FOR 4.7.1
56
+ * Issue should be fixed in 4.7.2 in which case this will be deleted.
57
+ */
58
+ function bodhi_svgs_disable_real_mime_check( $data, $file, $filename, $mimes ) {
59
+ $wp_filetype = wp_check_filetype( $filename, $mimes );
60
+
61
+ $ext = $wp_filetype['ext'];
62
+ $type = $wp_filetype['type'];
63
+ $proper_filename = $data['proper_filename'];
64
+
65
+ return compact( 'ext', 'type', 'proper_filename' );
66
+ }
67
+ add_filter( 'wp_check_filetype_and_ext', 'bodhi_svgs_disable_real_mime_check', 10, 4 );
68
+
69
  ?>