Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix file type extension check
  • Loading branch information
szk11001 committed Sep 14, 2015
1 parent 7e6c53a commit ecb4290
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion uc-people.php
Expand Up @@ -121,7 +121,8 @@ function importFile( $filename ){
require_once( ABSPATH . 'wp-admin/includes/file.php' );
}

if( $_FILES[$filename]['type'] !== 'text/csv' ){
$filePathInfo = pathinfo( $_FILES[$filename]['name'] );
if( $filePathInfo['extension'] !== 'csv' ){
echo '<div class="error notice is-dismissible below-h2" id="message"><p>Please upload a CSV file</p><button class="notice-dismiss" type="button"><span class="screen-reader-text">Dismiss this notice.</span></button></div>';
return;
}
Expand Down

0 comments on commit ecb4290

Please sign in to comment.