From d47c6816298ca6c7078147fde4cb68fd86f28e87 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Wed, 21 Dec 2011 16:37:19 +0000 Subject: [PATCH] made change to allow all file types for uploads --- codepot/src/codepot/controllers/file.php | 3 ++- codepot/src/codepot/controllers/wiki.php | 3 ++- codepot/src/system/libraries/Upload.php | 7 ++++++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/codepot/src/codepot/controllers/file.php b/codepot/src/codepot/controllers/file.php index d1f468a2..d7c23d2d 100644 --- a/codepot/src/codepot/controllers/file.php +++ b/codepot/src/codepot/controllers/file.php @@ -289,7 +289,8 @@ class File extends Controller $_FILES['file_name']['type'] = str_replace('\\', '', $_FILES['file_name']['type']); - $config['allowed_types'] = $ext; + //$config['allowed_types'] = $ext; + $config['allowed_types'] = '*'; $config['upload_path'] = CODEPOT_FILE_DIR; $config['max_size'] = CODEPOT_MAX_UPLOAD_SIZE; $config['encrypt_name'] = TRUE; diff --git a/codepot/src/codepot/controllers/wiki.php b/codepot/src/codepot/controllers/wiki.php index 5e72516a..5f48b27a 100644 --- a/codepot/src/codepot/controllers/wiki.php +++ b/codepot/src/codepot/controllers/wiki.php @@ -643,7 +643,8 @@ class Wiki extends Controller $_FILES[$field_name]['type'] = str_replace('\\', '', $_FILES[$field_name]['type']); - $config['allowed_types'] = $ext; + //$config['allowed_types'] = $ext; + $config['allowed_types'] = '*'; $config['upload_path'] = CODEPOT_ATTACHMENT_DIR; $config['max_size'] = CODEPOT_MAX_UPLOAD_SIZE; $config['encrypt_name'] = TRUE; diff --git a/codepot/src/system/libraries/Upload.php b/codepot/src/system/libraries/Upload.php index a97b7bdf..1a9aab22 100644 --- a/codepot/src/system/libraries/Upload.php +++ b/codepot/src/system/libraries/Upload.php @@ -578,6 +578,11 @@ class CI_Upload { $this->set_error('upload_no_file_types'); return FALSE; } + + if($this->allowed_types[0] == '*') + { + return true; + } $ext = strtolower(ltrim($this->file_ext, '.')); @@ -967,4 +972,4 @@ class CI_Upload { // END Upload Class /* End of file Upload.php */ -/* Location: ./system/libraries/Upload.php */ \ No newline at end of file +/* Location: ./system/libraries/Upload.php */