Skip to content
This repository has been archived by the owner. It is now read-only.

Fix file type extension check #9

Merged
merged 1 commit into from Sep 14, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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