summaryrefslogtreecommitdiff
path: root/modules/gallery/controllers/uploader.php
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2012-05-17 20:25:27 -0700
committerBharat Mediratta <bharat@menalto.com>2012-05-17 20:25:27 -0700
commit9e2ea2ffedb22f83137db4e5ba4c06b91f11e09d (patch)
tree2af0965685141af9cabcb01095dc431954de40e2 /modules/gallery/controllers/uploader.php
parent931da5f2ff68e3e4414583c39a22d62f13f87960 (diff)
Smash multiple extensions down into a single one when accepting file
uploads. Fixes #1872.
Diffstat (limited to 'modules/gallery/controllers/uploader.php')
-rw-r--r--modules/gallery/controllers/uploader.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/modules/gallery/controllers/uploader.php b/modules/gallery/controllers/uploader.php
index 906373b6..4ea55ff6 100644
--- a/modules/gallery/controllers/uploader.php
+++ b/modules/gallery/controllers/uploader.php
@@ -63,6 +63,10 @@ class Uploader_Controller extends Controller {
$item->parent_id = $album->id;
$item->set_data_file($temp_filename);
+ // Remove double extensions from the filename - they'll be disallowed in the model but if
+ // we don't do it here then it'll result in a failed upload.
+ $item->name = legal_file::smash_extensions($item->name);
+
$path_info = @pathinfo($temp_filename);
if (array_key_exists("extension", $path_info) &&
in_array(strtolower($path_info["extension"]), array("flv", "mp4", "m4v"))) {