Tuxedo Big File Uploads - Version 1.0.1

Version Description

  • Added fallback if the file info extension is missing.
Download this release

Release Info

Developer andtrev
Plugin Icon 128x128 Tuxedo Big File Uploads
Version 1.0.1
Comparing to
See all releases

Code changes from version 1.0 to 1.0.1

readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: andtrev
3
  Tags: AJAX, file uploader, files, files uploader, ftp, image uploader, plugin, upload
4
  Requires at least: 3.4
5
  Tested up to: 4.4.1
6
- Stable tag: 1.0
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -47,5 +47,8 @@ are uploaded and moved out of the temporary folder.
47
 
48
  == Changelog ==
49
 
 
 
 
50
  = 1.0 =
51
  * Initial release.
3
  Tags: AJAX, file uploader, files, files uploader, ftp, image uploader, plugin, upload
4
  Requires at least: 3.4
5
  Tested up to: 4.4.1
6
+ Stable tag: 1.0.1
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
47
 
48
  == Changelog ==
49
 
50
+ = 1.0.1 =
51
+ * Added fallback if the file info extension is missing.
52
+
53
  = 1.0 =
54
  * Initial release.
tux_handle_upload.php CHANGED
@@ -28,10 +28,21 @@ if ( ! function_exists( 'mime_content_type' ) ) {
28
  */
29
  function mime_content_type( $filename ) {
30
 
31
- $finfo = finfo_open( FILEINFO_MIME );
32
- $mimetype = finfo_file( $finfo, $filename );
33
- finfo_close( $finfo );
34
- return $mimetype;
 
 
 
 
 
 
 
 
 
 
 
35
 
36
  }
37
  }
28
  */
29
  function mime_content_type( $filename ) {
30
 
31
+ if ( function_exists( 'finfo_open' ) ) {
32
+ $finfo = finfo_open( FILEINFO_MIME );
33
+ $mimetype = finfo_file( $finfo, $filename );
34
+ finfo_close( $finfo );
35
+ return $mimetype;
36
+ } else {
37
+ ob_start();
38
+ system( 'file -i -b ' . $filename );
39
+ $output = ob_get_clean();
40
+ $output = explode( '; ', $output );
41
+ if ( is_array( $output ) ) {
42
+ $output = $output[0];
43
+ }
44
+ return $output;
45
+ }
46
 
47
  }
48
  }
tuxedo_big_file_uploads.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Tuxedo Big File Uploads
4
  * Plugin URI: https://github.com/andtrev/Tuxedo-Big-File-Uploads
5
  * Description: Enables large file uploads in the built-in WordPress media uploader.
6
- * Version: 1.0
7
  * Author: Trevor Anderson
8
  * Author URI: https://github.com/andtrev
9
  * License: GPLv2 or later
@@ -25,7 +25,7 @@
25
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26
  *
27
  * @package TuxedoBigFileUploads
28
- * @version 1.0.0
29
  */
30
 
31
  /**
3
  * Plugin Name: Tuxedo Big File Uploads
4
  * Plugin URI: https://github.com/andtrev/Tuxedo-Big-File-Uploads
5
  * Description: Enables large file uploads in the built-in WordPress media uploader.
6
+ * Version: 1.0.1
7
  * Author: Trevor Anderson
8
  * Author URI: https://github.com/andtrev
9
  * License: GPLv2 or later
25
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26
  *
27
  * @package TuxedoBigFileUploads
28
+ * @version 1.0.1
29
  */
30
 
31
  /**