Safe SVG - Version 1.9.9

Version Description

  • Fixed issue where 100% width is accidentally converted to 100px width. Props @joehoyle
Download this release

Release Info

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

Code changes from version 1.9.8 to 1.9.9

Files changed (2) hide show
  1. readme.txt +5 -2
  2. safe-svg.php +2 -2
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.4
7
  Requires PHP: 5.6
8
- Stable tag: 1.9.8
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -72,6 +72,9 @@ They take one argument that must be returned. See below for examples:
72
 
73
  == Changelog ==
74
 
 
 
 
75
  = 1.9.8 =
76
  * Underlying library update
77
 
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.4.1
7
  Requires PHP: 5.6
8
+ Stable tag: 1.9.9
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
72
 
73
  == Changelog ==
74
 
75
+ = 1.9.9 =
76
+ * Fixed issue where 100% width is accidentally converted to 100px width. Props @joehoyle
77
+
78
  = 1.9.8 =
79
  * Underlying library update
80
 
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.8
7
  Author: Daryll Doyle
8
  Author URI: http://enshrined.co.uk
9
  Text Domain: safe-svg
@@ -426,7 +426,7 @@ if ( ! class_exists( 'safe_svg' ) ) {
426
  $height = 0;
427
  if ( $svg ) {
428
  $attributes = $svg->attributes();
429
- if ( isset( $attributes->width, $attributes->height ) ) {
430
  $width = floatval( $attributes->width );
431
  $height = floatval( $attributes->height );
432
  } elseif ( isset( $attributes->viewBox ) ) {
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.9
7
  Author: Daryll Doyle
8
  Author URI: http://enshrined.co.uk
9
  Text Domain: safe-svg
426
  $height = 0;
427
  if ( $svg ) {
428
  $attributes = $svg->attributes();
429
+ if ( isset( $attributes->width, $attributes->height ) && is_numeric( $attributes->width ) && is_numeric( $attributes->height ) ) {
430
  $width = floatval( $attributes->width );
431
  $height = floatval( $attributes->height );
432
  } elseif ( isset( $attributes->viewBox ) ) {