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
This commit is contained in:
Andreas Piening 2010-06-01 04:40:45 +00:00 committed by Sam Minnee
parent 58a92cf456
commit 47ac736d50

View File

@ -533,7 +533,11 @@ class ModelAdmin_CollectionController extends Controller {
$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;