diff options
| author | Juuso Lapinlampi <wub@partyvan.eu> | 2015-09-27 15:03:33 +0200 |
|---|---|---|
| committer | Juuso Lapinlampi <wub@partyvan.eu> | 2015-09-27 15:03:33 +0200 |
| commit | 82d03a593aa0861a49b2d3964af1c10f39b153ac (patch) | |
| tree | 94d3a0626fcf598261afb6663f531008ee1fdada /static/upload.php | |
| parent | 43d0740dedb607c379661c96d20418ed9a8d7d75 (diff) | |
| parent | 8fb40f409adc557fbab1cf24b2e32879fa3a8aaf (diff) | |
Merge branch 'remove-moe-code-in-core' of WubTheCaptain/pomf
OK ewhal@
Diffstat (limited to 'static/upload.php')
| -rw-r--r-- | static/upload.php | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/static/upload.php b/static/upload.php index 9703ede..655dd9c 100644 --- a/static/upload.php +++ b/static/upload.php @@ -32,8 +32,6 @@ if (ini_get('zlib.output_compression') !== 'Off' ob_start('ob_gzhandler'); } -session_start(); - include_once 'classes/Response.class.php'; include_once 'classes/UploadException.class.php'; include_once 'classes/UploadedFile.class.php'; @@ -135,18 +133,9 @@ function upload_file($file) // Need to change permissions for the new file to make it world readable if (chmod(POMF_FILES_ROOT.$newname, 0644)) { // Add it to the database - if (empty($_SESSION['id'])) { - // Query if user is NOT logged in - $q = $db->prepare('INSERT INTO files (hash, originalname, filename, size, date, '. - 'expire, delid) VALUES (:hash, :orig, :name, :size, :date, '. - ':exp, :del)'); - } else { - // Query if user is logged in (insert user id together with other data) - $q = $db->prepare('INSERT INTO files (hash, originalname, filename, size, date, '. - 'expire, delid, user) VALUES (:hash, :orig, :name, :size, '. - ':date, :expires, :delid, :user)'); - $q->bindValue(':user', $_SESSION['id'], PDO::PARAM_INT); - } + $q = $db->prepare('INSERT INTO files (hash, originalname, filename, size, date, '. + 'expire, delid) VALUES (:hash, :orig, :name, :size, :date, '. + ':exp, :del)'); // Common parameters binding $q->bindValue(':hash', $file->get_sha1(), PDO::PARAM_STR); |
