aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/filestore.php
diff options
context:
space:
mode:
Diffstat (limited to 'engine/lib/filestore.php')
-rw-r--r--engine/lib/filestore.php26
1 files changed, 22 insertions, 4 deletions
diff --git a/engine/lib/filestore.php b/engine/lib/filestore.php
index d073a7000..dacde7c90 100644
--- a/engine/lib/filestore.php
+++ b/engine/lib/filestore.php
@@ -1156,9 +1156,18 @@
forward($forward . $container->username);
}
- function file_manage_download($plugin) {
+ /**
+ * Manage a file download.
+ *
+ * @param unknown_type $plugin
+ * @param unknown_type $file_guid If not specified then file_guid will be found in input.
+ */
+ function file_manage_download($plugin, $file_guid = "") {
// Get the guid
- $file_guid = get_input("file_guid");
+ $file_guid = (int)$file_guid;
+
+ if (!$file_guid)
+ $file_guid = (int)get_input("file_guid");
// Get the file
$file = get_entity($file_guid);
@@ -1183,9 +1192,18 @@
register_error(elgg_echo("$plugin:downloadfailed"));
}
- function file_manage_icon_download($plugin) {
+ /**
+ * Manage the download of a file icon.
+ *
+ * @param unknown_type $plugin
+ * @param unknown_type $file_guid The guid, if not specified this is obtained from the input.
+ */
+ function file_manage_icon_download($plugin, $file_guid = "") {
// Get the guid
- $file_guid = get_input("file_guid");
+ $file_guid = (int)$file_guid;
+
+ if (!$file_guid)
+ $file_guid = (int)get_input("file_guid");
// Get the file
$file = get_entity($file_guid);