// use same filename on the disk - ensures thumbnails are overwritten
$filestorename = $file->getFilename();
- $filestorename = substr($filestorename, strlen($prefix));
+ $filestorename = elgg_substr($filestorename, elgg_strlen($prefix));
} else {
- $filestorename = strtolower(time().$_FILES['upload']['name']);
+ $filestorename = elgg_strtolower(time().$_FILES['upload']['name']);
}
$file->setFilename($prefix.$filestorename);
unset($thumblarge);
}
}
+ } else {
+ // not saving a file but still need to save the entity to push attributes to database
+ $file->save();
}
// make sure session cache is cleared
//check that the user can edit as well as admin
if ($post->canEdit() || ($post->owner_guid == $_SESSION['user']->guid)) {
- //delete
+ //delete forum comment
$post->delete();
+
+ // remove river entry if it exists
+ remove_from_river_by_annotation($post_id);
+
//display confirmation message
system_message(elgg_echo("grouppost:deleted"));
-
}
} else {