WP Extra File Types - Version 0.4.3

Version Description

  • fix on custom file types
Download this release

Release Info

Developer davide.airaghi
Plugin Icon 128x128 WP Extra File Types
Version 0.4.3
Comparing to
See all releases

Code changes from version 0.4.2 to 0.4.3

Files changed (2) hide show
  1. readme.txt +5 -2
  2. wp-extra-file-types.php +2 -1
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: davide.airaghi
3
  Tags: file type, upload, media library
4
  Requires at least: 4.0
5
- Tested up to: 5.0.2
6
- Stable tag: 0.4.2
7
  License: GPLv2 or later
8
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -22,6 +22,9 @@ supported by the Media Library upload procedure.
22
 
23
  == Changelog ==
24
 
 
 
 
25
  = 0.4.2 =
26
  * mime types database updated
27
 
2
  Contributors: davide.airaghi
3
  Tags: file type, upload, media library
4
  Requires at least: 4.0
5
+ Tested up to: 5.2.3
6
+ Stable tag: 0.4.3
7
  License: GPLv2 or later
8
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
9
 
22
 
23
  == Changelog ==
24
 
25
+ = 0.4.3 =
26
+ * fix on custom file types
27
+
28
  = 0.4.2 =
29
  * mime types database updated
30
 
wp-extra-file-types.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: WP Extra File Types
4
  * Description: Plugin to let you extend the list of allowed file types supported by the Wordpress Media Library.
5
  * Plugin URI: http://www.airaghi.net/en/2015/01/02/wordpress-custom-mime-types/
6
- * Version: 0.4.2
7
  * Author: Davide Airaghi
8
  * Author URI: http://www.airaghi.net
9
  * License: GPLv2 or later
@@ -109,6 +109,7 @@ class WPEFT {
109
  $ext = trim($_POST['custom_e'][$k]);
110
  $mime = trim($_POST['custom_m'][$k]);
111
  if ($ext=='' || $mime=='') { continue; }
 
112
  if (!substr($ext,0,1)=='.') { $ext = '.'.$ext; }
113
  $custom[] = array( 'description'=>$description, 'extension'=>$ext, 'mime'=>$mime );
114
  }
3
  * Plugin Name: WP Extra File Types
4
  * Description: Plugin to let you extend the list of allowed file types supported by the Wordpress Media Library.
5
  * Plugin URI: http://www.airaghi.net/en/2015/01/02/wordpress-custom-mime-types/
6
+ * Version: 0.4.3
7
  * Author: Davide Airaghi
8
  * Author URI: http://www.airaghi.net
9
  * License: GPLv2 or later
109
  $ext = trim($_POST['custom_e'][$k]);
110
  $mime = trim($_POST['custom_m'][$k]);
111
  if ($ext=='' || $mime=='') { continue; }
112
+ if (strpos($mime,'/')===false) { $mime = 'application/octet-stream'; }
113
  if (!substr($ext,0,1)=='.') { $ext = '.'.$ext; }
114
  $custom[] = array( 'description'=>$description, 'extension'=>$ext, 'mime'=>$mime );
115
  }