Safe SVG - Version 1.9.3

Version Description

  • Fixed a bug cusing 0 height and width SVGs
Download this release

Release Info

Developer enshrined
Plugin Icon 128x128 Safe SVG
Version 1.9.3
Comparing to
See all releases

Code changes from version 1.9.2 to 1.9.3

Files changed (2) hide show
  1. readme.txt +5 -2
  2. safe-svg.php +7 -3
readme.txt CHANGED
@@ -3,9 +3,9 @@ Contributors: enshrined
3
  Donate link: https://wpsvg.com/
4
  Tags: svg, sanitize, upload, sanitise, security, svg upload, image, vector, file, graphic, media, mime
5
  Requires at least: 4.0
6
- Tested up to: 5.0.2
7
  Requires PHP: 5.6
8
- Stable tag: 1.9.2
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -62,6 +62,9 @@ They take one argument that must be returned. See below for examples:
62
 
63
  == Changelog ==
64
 
 
 
 
65
  = 1.9.2 =
66
  * Fixed a warning about an Illegal string offset
67
  * Fixed an issue if something other than a WP_Post object is passed in via the `wp_get_attachment_image_attributes` filter.
3
  Donate link: https://wpsvg.com/
4
  Tags: svg, sanitize, upload, sanitise, security, svg upload, image, vector, file, graphic, media, mime
5
  Requires at least: 4.0
6
+ Tested up to: 5.1
7
  Requires PHP: 5.6
8
+ Stable tag: 1.9.3
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
62
 
63
  == Changelog ==
64
 
65
+ = 1.9.3 =
66
+ * Fixed a bug cusing 0 height and width SVGs
67
+
68
  = 1.9.2 =
69
  * Fixed a warning about an Illegal string offset
70
  * Fixed an issue if something other than a WP_Post object is passed in via the `wp_get_attachment_image_attributes` filter.
safe-svg.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Safe SVG
4
  Plugin URI: https://wpsvg.com/
5
  Description: Allows SVG uploads into WordPress and sanitizes the SVG before saving it
6
- Version: 1.9.2
7
  Author: Daryll Doyle
8
  Author URI: http://enshrined.co.uk
9
  Text Domain: safe-svg
@@ -332,9 +332,13 @@ if ( ! class_exists( 'safe_svg' ) ) {
332
 
333
  $dimensions = $this->svg_dimensions( $svg_path );
334
 
 
 
 
 
335
  $metadata = array(
336
- 'width' => intval( $dimensions->width ),
337
- 'height' => intval( $dimensions->height ),
338
  'file' => $relative_path
339
  );
340
 
3
  Plugin Name: Safe SVG
4
  Plugin URI: https://wpsvg.com/
5
  Description: Allows SVG uploads into WordPress and sanitizes the SVG before saving it
6
+ Version: 1.9.3
7
  Author: Daryll Doyle
8
  Author URI: http://enshrined.co.uk
9
  Text Domain: safe-svg
332
 
333
  $dimensions = $this->svg_dimensions( $svg_path );
334
 
335
+ if ( ! $dimensions ) {
336
+ return $metadata;
337
+ }
338
+
339
  $metadata = array(
340
+ 'width' => intval( $dimensions['width'] ),
341
+ 'height' => intval( $dimensions['height'] ),
342
  'file' => $relative_path
343
  );
344