Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request weblab#9 from szk11001/master
Fix file type extension check
  • Loading branch information
jmr06005 committed Sep 14, 2015
2 parents 116633d + ecb4290 commit e705c9a
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 e705c9a

Please sign in to comment.