Skip to content

Commit

Permalink
Correct list of accepted files for dropzone
Browse files Browse the repository at this point in the history
Dropzone needs "." as prefix for accepted file extension [1]

Fixes #22169

[1] http://www.dropzonejs.com/#config-acceptedFiles
  • Loading branch information
atrol committed Jan 17, 2017
1 parent 52da83a commit 05552f5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions core/print_api.php
Expand Up @@ -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";
Expand Down Expand Up @@ -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 );
}
}

0 comments on commit 05552f5

Please sign in to comment.