diff options
author | Bharat Mediratta <bharat@menalto.com> | 2009-02-21 20:58:02 +0000 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2009-02-21 20:58:02 +0000 |
commit | 2505bd157932a369cc006dd8fc0dd80b57b22b69 (patch) | |
tree | 21b064cb7a1fa1cd99ebc6238cd5bcc680dea683 /modules | |
parent | 855eadb92fc4b63a8a46004e1c59f0b221e72330 (diff) |
Hardcode extensions instead of using Image::$allowed_types because we
don't support TIFF files. TIFF files are not viewable directly in
most browsers
Diffstat (limited to 'modules')
-rw-r--r-- | modules/local_import/controllers/local_import.php | 8 | ||||
-rw-r--r-- | modules/watermark/controllers/admin_watermarks.php | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/modules/local_import/controllers/local_import.php b/modules/local_import/controllers/local_import.php index a841434f..9303c54f 100644 --- a/modules/local_import/controllers/local_import.php +++ b/modules/local_import/controllers/local_import.php @@ -23,7 +23,7 @@ class Local_Import_Controller extends Controller { $item = ORM::factory("item", $id); access::can("local_import", $item); - + $view = new View("local_import_tree_dialog.html"); $view->action = url::site("local_import/add/$id"); $view->hidden = array("csrf" => access::csrf_token(), "base_url" => url::base(true)); @@ -47,7 +47,7 @@ class Local_Import_Controller extends Controller { if (!is_readable($path)) { kohana::show_404(); } - + $tree = new View("local_import_tree.html"); $tree->data = $this->_get_children($path); $tree->uid = "tree_" . md5($path); @@ -62,7 +62,7 @@ class Local_Import_Controller extends Controller { if (!$parent->loaded) { throw new Exception("@todo BAD_ALBUM"); } - + $path = $this->input->post("path"); set_time_limit(30); @@ -85,7 +85,7 @@ class Local_Import_Controller extends Controller { $extension = strtolower(substr(strrchr($file, '.'), 1)); // Make sure the file is readable if (is_readable($full_path) && - in_array($extension, Image::$allowed_types)) { + in_array($extension, array("gif", "jpg", "jpeg", "png"))) { $file_list[$file] = array("path" => $full_path); } } diff --git a/modules/watermark/controllers/admin_watermarks.php b/modules/watermark/controllers/admin_watermarks.php index dc20dc32..42ef0d87 100644 --- a/modules/watermark/controllers/admin_watermarks.php +++ b/modules/watermark/controllers/admin_watermarks.php @@ -99,7 +99,7 @@ class Admin_Watermarks_Controller extends Admin_Controller { $name = preg_replace("/uploadfile-[^-]+-(.*)/", '$1', $pathinfo["basename"]); if (!($image_info = getimagesize($file)) || - !in_array($image_info[2], Image::$allowed_types)) { + !in_array($image_info[2], array("gif", "jpg", "jpeg", "png"))) { message::error(t("Unable to identify this image file")); @unlink($file); return; |