Version Description
- Enhanced error checking when retrieving serialized data.
Download this release
Release Info
Developer | kimipooh |
Plugin | WP Add Mime Types |
Version | 3.0.2 |
Comparing to | |
See all releases |
Code changes from version 3.0.1 to 3.0.2
- readme.txt +4 -1
- wp-add-mime-types.php +5 -6
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Tags: mime,file extention
|
|
4 |
Requires at least: 4.0
|
5 |
Requires PHP: 5.6
|
6 |
Tested up to: 6.0
|
7 |
-
Stable tag: 3.0.
|
8 |
License: GPL v2
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -88,6 +88,9 @@ The files which has "bmp" file extention becomes not to be able to upload.
|
|
88 |
4. Security Options
|
89 |
|
90 |
== Changelog ==
|
|
|
|
|
|
|
91 |
= 3.0.1 =
|
92 |
- Fixed warning when the $settings data gets.
|
93 |
|
4 |
Requires at least: 4.0
|
5 |
Requires PHP: 5.6
|
6 |
Tested up to: 6.0
|
7 |
+
Stable tag: 3.0.2
|
8 |
License: GPL v2
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
88 |
4. Security Options
|
89 |
|
90 |
== Changelog ==
|
91 |
+
= 3.0.2 =
|
92 |
+
- Enhanced error checking when retrieving serialized data.
|
93 |
+
|
94 |
= 3.0.1 =
|
95 |
- Fixed warning when the $settings data gets.
|
96 |
|
wp-add-mime-types.php
CHANGED
@@ -3,13 +3,13 @@
|
|
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: 3.0.
|
7 |
Author: Kimiya Kitani
|
8 |
Author URI: http://kitaney-wordpress.blogspot.jp/
|
9 |
Text Domain: wp-add-mime-types
|
10 |
Domain Path: /lang
|
11 |
*/
|
12 |
-
define('WAMT_DEFAULT_VAR', '3.0.
|
13 |
define('WAMT_PLUGIN_DIR', 'wp-add-mime-types');
|
14 |
define('WAMT_PLUGIN_NAME', 'wp-add-mime-types');
|
15 |
define('WAMT_PLUGIN_BASENAME', WAMT_PLUGIN_DIR . '/' . WAMT_PLUGIN_NAME . '.php');
|
@@ -43,7 +43,7 @@ add_action('admin_menu', 'wamt_add_to_settings_menu');
|
|
43 |
|
44 |
// Procedure for adding the mime types and file extensions to WordPress.
|
45 |
function wamt_add_allow_upload_extension( $mimes ) {
|
46 |
-
$mime_type_values =
|
47 |
|
48 |
if ( ! function_exists( 'is_plugin_active_for_network' ) )
|
49 |
require_once( ABSPATH . '/wp-admin/includes/plugin.php' );
|
@@ -53,10 +53,9 @@ function wamt_add_allow_upload_extension( $mimes ) {
|
|
53 |
else
|
54 |
$settings = get_option(WAMT_SETTING_FILE);
|
55 |
|
56 |
-
|
57 |
-
// else
|
58 |
$mime_type_values = unserialize($settings['mime_type_values']);
|
59 |
-
if(
|
60 |
|
61 |
if(!empty($mime_type_values)){
|
62 |
foreach ((array)$mime_type_values as $line){
|
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: 3.0.2
|
7 |
Author: Kimiya Kitani
|
8 |
Author URI: http://kitaney-wordpress.blogspot.jp/
|
9 |
Text Domain: wp-add-mime-types
|
10 |
Domain Path: /lang
|
11 |
*/
|
12 |
+
define('WAMT_DEFAULT_VAR', '3.0.2');
|
13 |
define('WAMT_PLUGIN_DIR', 'wp-add-mime-types');
|
14 |
define('WAMT_PLUGIN_NAME', 'wp-add-mime-types');
|
15 |
define('WAMT_PLUGIN_BASENAME', WAMT_PLUGIN_DIR . '/' . WAMT_PLUGIN_NAME . '.php');
|
43 |
|
44 |
// Procedure for adding the mime types and file extensions to WordPress.
|
45 |
function wamt_add_allow_upload_extension( $mimes ) {
|
46 |
+
$mime_type_values = array();
|
47 |
|
48 |
if ( ! function_exists( 'is_plugin_active_for_network' ) )
|
49 |
require_once( ABSPATH . '/wp-admin/includes/plugin.php' );
|
53 |
else
|
54 |
$settings = get_option(WAMT_SETTING_FILE);
|
55 |
|
56 |
+
if( !isset($settings['mime_type_values'] ) ) return $mimes;
|
|
|
57 |
$mime_type_values = unserialize($settings['mime_type_values']);
|
58 |
+
if( empty($mime_type_values) ) return $mimes;
|
59 |
|
60 |
if(!empty($mime_type_values)){
|
61 |
foreach ((array)$mime_type_values as $line){
|