From 4ebc7100f68bfe1f9beefa7fd1d3c937754def92 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sat, 11 May 2013 08:22:03 -0400 Subject: Fixes #5422 fixes tag processing for file plugin --- mod/file/actions/file/upload.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'mod/file/actions/file/upload.php') diff --git a/mod/file/actions/file/upload.php b/mod/file/actions/file/upload.php index d6dce2528..7ee402121 100644 --- a/mod/file/actions/file/upload.php +++ b/mod/file/actions/file/upload.php @@ -71,9 +71,7 @@ $file->title = $title; $file->description = $desc; $file->access_id = $access_id; $file->container_guid = $container_guid; - -$tags = explode(",", $tags); -$file->tags = $tags; +$file->tags = string_to_tag_array($tags); // we have a file upload, so process it if (isset($_FILES['upload']['name']) && !empty($_FILES['upload']['name'])) { -- cgit v1.2.3 From 0d3c2bcf71a493cb5b0923227a2b043a09762fdb Mon Sep 17 00:00:00 2001 From: Jeroen Dalsem Date: Tue, 22 Oct 2013 16:46:06 +0200 Subject: remove thumbnails if no longer needed --- mod/file/actions/file/upload.php | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'mod/file/actions/file/upload.php') diff --git a/mod/file/actions/file/upload.php b/mod/file/actions/file/upload.php index 7ee402121..e20c4079f 100644 --- a/mod/file/actions/file/upload.php +++ b/mod/file/actions/file/upload.php @@ -165,6 +165,23 @@ if (isset($_FILES['upload']['name']) && !empty($_FILES['upload']['name'])) { $file->largethumb = $prefix."largethumb".$filestorename; unset($thumblarge); } + } elseif ($file->icontime) { + // if it is not an image, we do not need thumbnails + unset($file->icontime); + + $thumb = new ElggFile(); + + $thumb->setFilename($prefix . "thumb" . $filestorename); + $thumb->delete(); + unset($file->thumbnail); + + $thumb->setFilename($prefix . "smallthumb" . $filestorename); + $thumb->delete(); + unset($file->smallthumb); + + $thumb->setFilename($prefix . "largethumb" . $filestorename); + $thumb->delete(); + unset($file->largethumb); } } else { // not saving a file but still need to save the entity to push attributes to database @@ -202,4 +219,4 @@ if ($new_file) { } forward($file->getURL()); -} +} -- cgit v1.2.3