diff options
| author | Peter Lejeck <peter.lejeck@gmail.com> | 2013-11-01 01:40:10 +0100 |
|---|---|---|
| committer | Peter Lejeck <peter.lejeck@gmail.com> | 2013-11-01 01:40:10 +0100 |
| commit | cfb6ce0d349280c260299c3dee6771a5228f4de5 (patch) | |
| tree | 49c9468e826e8636ebd918f0aaee31e5a9d0df28 /static | |
| parent | 431357168b22a0c4a4f7dbd022e770cd2b734bdc (diff) | |
Fix deduplication
Diffstat (limited to 'static')
| -rw-r--r-- | static/upload.php | 7 |
1 files changed, 6 insertions, 1 deletions
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); |
