From 05552f5246bb74ded6e9b1a49017a2413636a5fb Mon Sep 17 00:00:00 2001 From: Roland Becker Date: Tue, 17 Jan 2017 10:16:12 +0100 Subject: [PATCH] Correct list of accepted files for dropzone Dropzone needs "." as prefix for accepted file extension [1] Fixes #22169 [1] http://www.dropzonejs.com/#config-acceptedFiles --- core/print_api.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/print_api.php b/core/print_api.php index a39a3798aa..fc1f320d84 100644 --- a/core/print_api.php +++ b/core/print_api.php @@ -2093,7 +2093,11 @@ function print_max_filesize( $p_size, $p_divider = 1000, $p_unit = 'kb' ) { function print_dropzone_form_data() { echo 'data-force-fallback="' . ( config_get( 'dropzone_enabled' ) ? 'false' : 'true' ) . '"' . "\n"; echo "\t" . 'data-max-filesize="'. ceil( config_get( 'max_file_size' ) / (1000 * 1024) ) . '"' . "\n"; - echo "\t" . 'data-accepted-files="' . config_get( 'allowed_files' ) . '"' . "\n"; + $t_allowed_files = config_get( 'allowed_files' ); + if ( !empty ( $t_allowed_files ) ) { + $t_allowed_files = '.' . implode ( ',.', explode ( ',', config_get( 'allowed_files' ) ) ); + } + echo "\t" . 'data-accepted-files="' . $t_allowed_files . '"' . "\n"; echo "\t" . 'data-default-message="' . htmlspecialchars( lang_get( 'dropzone_default_message' ) ) . '"' . "\n"; echo "\t" . 'data-fallback-message="' . htmlspecialchars( lang_get( 'dropzone_fallback_message' ) ) . '"' . "\n"; echo "\t" . 'data-fallback-text="' . htmlspecialchars( lang_get( 'dropzone_fallback_text' ) ) . '"' . "\n"; @@ -2125,4 +2129,4 @@ function print_button( $p_action_page, $p_label, array $p_args_to_post = null, $ error_parameters( __FUNCTION__, 'print_form_button' ); trigger_error( ERROR_DEPRECATED_SUPERSEDED, DEPRECATED ); print_form_button( $p_action_page, $p_label, $p_args_to_post, $p_security_token ); -} \ No newline at end of file +}