Safe SVG - Version 1.4.2

Version Description

  • Added a check / fix for when mb_* functions are not available
Download this release

Release Info

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

Code changes from version 1.4.1 to 1.4.2

Files changed (2) hide show
  1. readme.txt +4 -1
  2. safe-svg.php +6 -2
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://enshrined.co.uk
4
  Tags: svg, sanitize, uploads, sanitise, security, svg upload
5
  Requires at least: 4.0
6
  Tested up to: 4.7.2
7
- Stable tag: 1.4.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -24,6 +24,9 @@ Install through the WordPress directory or download, unzip and upload the files
24
 
25
  == Changelog ==
26
 
 
 
 
27
  = 1.4.1 =
28
  * Updated underlying library to allow attributes/tags in all case variations
29
 
4
  Tags: svg, sanitize, uploads, sanitise, security, svg upload
5
  Requires at least: 4.0
6
  Tested up to: 4.7.2
7
+ Stable tag: 1.4.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
24
 
25
  == Changelog ==
26
 
27
+ = 1.4.2 =
28
+ * Added a check / fix for when mb_* functions are not available
29
+
30
  = 1.4.1 =
31
  * Updated underlying library to allow attributes/tags in all case variations
32
 
safe-svg.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Safe SVG
4
  Plugin URI: https://wordpress.org/plugins/safe-svg/
5
  Description: Allows SVG uploads into WordPress and sanitizes the SVG before saving it
6
- Version: 1.4.1
7
  Author: Daryll Doyle
8
  Author URI: http://enshrined.co.uk
9
  Text Domain: safe-svg
@@ -148,7 +148,11 @@ if ( ! class_exists( 'safe_svg' ) ) {
148
  * @return bool
149
  */
150
  protected function is_gzipped( $contents ) {
151
- return 0 === mb_strpos( $contents , "\x1f" . "\x8b" . "\x08" );
 
 
 
 
152
  }
153
 
154
  /**
3
  Plugin Name: Safe SVG
4
  Plugin URI: https://wordpress.org/plugins/safe-svg/
5
  Description: Allows SVG uploads into WordPress and sanitizes the SVG before saving it
6
+ Version: 1.4.2
7
  Author: Daryll Doyle
8
  Author URI: http://enshrined.co.uk
9
  Text Domain: safe-svg
148
  * @return bool
149
  */
150
  protected function is_gzipped( $contents ) {
151
+ if ( function_exists( 'mb_strpos' ) ) {
152
+ return 0 === mb_strpos( $contents, "\x1f" . "\x8b" . "\x08" );
153
+ } else {
154
+ return 0 === strpos( $contents, "\x1f" . "\x8b" . "\x08" );
155
+ }
156
  }
157
 
158
  /**