aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/filestore.php
diff options
context:
space:
mode:
authormarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-06-24 14:45:02 +0000
committermarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-06-24 14:45:02 +0000
commit4df70c318e3d39d0ff6d1bf3afb826f52ac34625 (patch)
tree5b9df507ababe096551990a8db086047b4ea56a3 /engine/lib/filestore.php
parent2422303af8a1172bad40c9d7b2e219b578d26ae5 (diff)
downloadelgg-4df70c318e3d39d0ff6d1bf3afb826f52ac34625.tar.gz
elgg-4df70c318e3d39d0ff6d1bf3afb826f52ac34625.tar.bz2
Some tidying of file download manager functions.
git-svn-id: https://code.elgg.org/elgg/trunk@3351 36083f99-b078-4883-b0ff-0f9b5a30f544
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);