aboutsummaryrefslogtreecommitdiff
path: root/mod/file/actions
diff options
context:
space:
mode:
authorSem <sembrestels@riseup.net>2014-01-22 03:37:52 +0100
committerSem <sembrestels@riseup.net>2014-01-22 03:37:52 +0100
commit4a2ed114bb18c5363f594a380676c5654f4165a4 (patch)
tree3a37094b249c40e3e6bf122691db53115f65f8f0 /mod/file/actions
parent673932bc46a3918293a28c2c2fc622b3e5ff6bde (diff)
parent0dd36c458d41e77521c36ae572fe73114ad4bc5a (diff)
downloadelgg-4a2ed114bb18c5363f594a380676c5654f4165a4.tar.gz
elgg-4a2ed114bb18c5363f594a380676c5654f4165a4.tar.bz2
Merge tag '1.8.18' of git://github.com/Elgg/Elgg into develop
1.8.18 Conflicts: mod/tinymce/vendor/tinymce/jscripts/tiny_mce/langs/en.js mod/tinymce/vendor/tinymce/jscripts/tiny_mce/themes/advanced/langs/en_dlg.js
Diffstat (limited to 'mod/file/actions')
-rw-r--r--mod/file/actions/file/upload.php23
1 files changed, 19 insertions, 4 deletions
diff --git a/mod/file/actions/file/upload.php b/mod/file/actions/file/upload.php
index d6dce2528..e20c4079f 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'])) {
@@ -167,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
@@ -204,4 +219,4 @@ if ($new_file) {
}
forward($file->getURL());
-}
+}