Skip to content

Commit 39a5907

Browse files
authored
Merge pull request #92 from rinatkhaziev/fix/infinite-loop
1.3.4
2 parents ac8f408 + b697c52 commit 39a5907

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

frontend-uploader.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Plugin Name: Frontend Uploader
44
Description: Allow your visitors to upload content and moderate it.
55
Author: Rinat Khaziev, Daniel Bachhuber
6-
Version: 1.3.3
6+
Version: 1.3.4
77
Author URI: https://rinat.dev/
88
Text Domain: frontend-uploader
99
Requires at least: 4.6
@@ -28,7 +28,7 @@
2828
*/
2929

3030
// Define consts and bootstrap and dependencies
31-
define( 'FU_VERSION', '1.3.3' );
31+
define( 'FU_VERSION', '1.3.4' );
3232
define( 'FU_ROOT' , dirname( __FILE__ ) );
3333
define( 'FU_FILE_PATH' , FU_ROOT . '/' . basename( __FILE__ ) );
3434
define( 'FU_URL' , plugins_url( '/', __FILE__ ) );
@@ -155,7 +155,9 @@ function _set_language() {
155155
*/
156156
function _get_mime_types() {
157157
// $mime_types_orig is needed to re-map the values from the settings lib structure to core WP extension regex => mime-type format.
158+
remove_filter( 'upload_mimes', [ $this, '_get_mime_types' ], 999 );
158159
$mime_types = $mime_types_orig = get_allowed_mime_types();
160+
add_filter( 'upload_mimes', [ $this, '_get_mime_types' ], 999 );
159161

160162
$enabled = isset( $this->settings['enabled_files'] ) && is_array( $this->settings['enabled_files'] ) && $this->settings['enabled_files'] ? $this->settings['enabled_files'] : $mime_types;
161163

@@ -172,6 +174,7 @@ function _get_mime_types() {
172174

173175
unset( $enabled['htm|html'] );
174176
unset( $enabled['js'] );
177+
unset( $enabled['svg|svgz'] );
175178

176179
/**
177180
* Configuration filter: fu_allowed_mime_types should return array of allowed mime types (see readme)

readme.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Tags: frontend, image, images, media, uploader, upload, video, audio, photo, pho
55
Requires at least: 4.6
66
Requires PHP: 7.2
77
Tested up to: 5.9
8-
Stable tag: 1.3.3
8+
Stable tag: 1.3.4
99
License: GPLv2 or later
1010

1111
This plugin allows your visitors to upload User Generated Content (media and posts/custom-post-types with media).
@@ -400,6 +400,9 @@ function my_fu_upload_result( $layout, $result ) {
400400

401401
== Changelog ==
402402

403+
= 1.3.4 (Jan 26, 2022) =
404+
* Bugfix: the new allow type logic resulted in an infinite loop in some cases
405+
403406
= 1.3.3 (Aug 28, 2021) =
404407
* Re-worked the way file type allow list works
405408
* Readme formatting updates to hopefully make it clearer

0 commit comments

Comments
 (0)