Browse files

MINOR: add text/plain to the list of accepted mime types

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.4@105985 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information...
1 parent 58a92cf commit 47ac736d505015fdf82709876fdd0dd5de96a0d6 Andreas Piening committed with sminnee Jun 1, 2010
Showing with 5 additions and 1 deletion.
  1. +5 −1 code/ModelAdmin.php
View
6 code/ModelAdmin.php
@@ -533,7 +533,11 @@ function import($data, $form, $request) {
$loader = new $importerClass($data['ClassName']);
// File wasn't properly uploaded, show a reminder to the user
- if(empty($_FILES['_CsvFile']['tmp_name']) || $_FILES['_CsvFile']['type'] != 'text/csv' || file_get_contents($_FILES['_CsvFile']['tmp_name']) == '') {
+ if(
+ empty($_FILES['_CsvFile']['tmp_name']) ||
+ array_search($_FILES['_CsvFile']['type'], array('text/csv', 'text/plain')) === false ||
+ file_get_contents($_FILES['_CsvFile']['tmp_name']) == ''
+ ) {
$form->sessionMessage(_t('ModelAdmin.NOCSVFILE', 'Please browse for a CSV file to import'), 'good');
Director::redirectBack();
return false;

0 comments on commit 47ac736

Please sign in to comment.