From cfb6ce0d349280c260299c3dee6771a5228f4de5 Mon Sep 17 00:00:00 2001 From: Peter Lejeck Date: Thu, 31 Oct 2013 17:40:10 -0700 Subject: Fix deduplication --- static/upload.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/static/upload.php b/static/upload.php index da5e311..e2a3016 100644 --- a/static/upload.php +++ b/static/upload.php @@ -56,7 +56,12 @@ function upload_file ($file) { // the previous data. if ($result['hash'] === $file->get_sha1()) { unlink($file->tempfile); - return $result; + return array( + 'hash' => $result['hash'], + 'name' => $file->name, + 'url' => $result['filename'], + 'size' => $result['size'] + ); } else { // Generate a name for the file $newname = generate_name($file); -- cgit v1.2.3