WP Add Mime Types - Version 2.1.2

Version Description

  • Fixed the warning issue regarding explode function.
  • Tested up to WordPress 4.7.2
Download this release

Release Info

Developer kimipooh
Plugin Icon wp plugin WP Add Mime Types
Version 2.1.2
Comparing to
See all releases

Code changes from version 2.1.1 to 2.1.2

Files changed (2) hide show
  1. readme.txt +6 -2
  2. wp-add-mime-types.php +8 -4
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: Kimiya Kitani
3
  Tags: mime,file extention
4
  Requires at least: 3.0
5
- Tested up to: 4.7.1
6
- Stable tag: 2.1.1
7
 
8
  The plugin additionally allows the mime types and file extensions to WordPress.
9
 
@@ -60,6 +60,10 @@ Yes, each setting values are saved as the other setting items.
60
 
61
  == Changelog ==
62
 
 
 
 
 
63
  = 2.1.1 =
64
  * Fixed the issue that the safe files in WordPress, such as jpg, png, pdf cannot be uploaded.
65
 
2
  Contributors: Kimiya Kitani
3
  Tags: mime,file extention
4
  Requires at least: 3.0
5
+ Tested up to: 4.7.2
6
+ Stable tag: 2.1.2
7
 
8
  The plugin additionally allows the mime types and file extensions to WordPress.
9
 
60
 
61
  == Changelog ==
62
 
63
+ = 2.1.2 =
64
+ * Fixed the warning issue regarding explode function.
65
+ * Tested up to WordPress 4.7.2
66
+
67
  = 2.1.1 =
68
  * Fixed the issue that the safe files in WordPress, such as jpg, png, pdf cannot be uploaded.
69
 
wp-add-mime-types.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: WP Add Mime Types
4
  Plugin URI:
5
  Description: The plugin additionally allows the mime types and file extensions to WordPress.
6
- Version: 2.1.1
7
  Author: Kimiya Kitani
8
  Author URI: http://kitaney-wordpress.blogspot.jp/
9
  Text Domain: wp-add-mime-types
@@ -65,9 +65,13 @@ add_filter( 'upload_mimes', 'add_allow_upload_extension');
65
  // In case of custom extension in this plugins' setting, the WordPress 4.7.1 file contents check system is always true.
66
  function add_allow_upload_extension_exception( $file, $filename, $mimes ) {
67
  global $plugin_basename;
68
- list($ext, $type, $proper_filename) = explode($file);
69
- list($f_name,$f_ext) = explode(".", $mimes);
70
- if($ext != false && $type != false) return $file;
 
 
 
 
71
 
72
  if ( ! function_exists( 'is_plugin_active_for_network' ) )
73
  require_once( ABSPATH . '/wp-admin/includes/plugin.php' );
3
  Plugin Name: WP Add Mime Types
4
  Plugin URI:
5
  Description: The plugin additionally allows the mime types and file extensions to WordPress.
6
+ Version: 2.1.2
7
  Author: Kimiya Kitani
8
  Author URI: http://kitaney-wordpress.blogspot.jp/
9
  Text Domain: wp-add-mime-types
65
  // In case of custom extension in this plugins' setting, the WordPress 4.7.1 file contents check system is always true.
66
  function add_allow_upload_extension_exception( $file, $filename, $mimes ) {
67
  global $plugin_basename;
68
+ $ext = $type = $proper_filename = false;
69
+ if(isset($file['ext'])) $ext = $file['ext'];
70
+ if(isset($file['type'])) $ext = $file['type'];
71
+ if(isset($file['proper_filename'])) $ext = $file['proper_filename'];
72
+ if($ext != false && $type != false) return $file;
73
+
74
+ list($f_name,$f_ext) = explode(".", $mimes);
75
 
76
  if ( ! function_exists( 'is_plugin_active_for_network' ) )
77
  require_once( ABSPATH . '/wp-admin/includes/plugin.php' );