Skip to content

Commit

Permalink
Apply proper sanitization to upload filenames
Browse files Browse the repository at this point in the history
  • Loading branch information
sheabunge committed May 13, 2022
1 parent cff34c6 commit 32dea96
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions php/admin-menus/class-import-menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ private function process_import_files() {
$network = is_network_admin();
$error = false;

$upload_files = array_map( 'sanitize_file_name', $_FILES['code_snippets_import_files']['tmp_name'] );
$upload_filenames = array_map( 'sanitize_file_name', $_FILES['code_snippets_import_files']['name'] );
$upload_files = array_map( 'sanitize_text_field', $_FILES['code_snippets_import_files']['tmp_name'] );
$upload_filenames = array_map( 'sanitize_text_field', $_FILES['code_snippets_import_files']['name'] );
$upload_mime_types = array_map( 'sanitize_mime_type', $_FILES['code_snippets_import_files']['type'] );

$dup_action = isset( $_POST['duplicate_action'] ) ? sanitize_key( $_POST['duplicate_action'] ) : 'ignore';
Expand Down

0 comments on commit 32dea96

Please sign in to comment.