From 16515a67ff2943a91c4e5678840933460b53e9c0 Mon Sep 17 00:00:00 2001 From: Eliot Whalan Date: Thu, 24 Sep 2015 17:26:06 +1000 Subject: Fix bug introduced in 6c82d36307. Newline broke JS --- js/pomf.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/pomf.js b/js/pomf.js index 560dd8e..c2e6264 100644 --- a/js/pomf.js +++ b/js/pomf.js @@ -117,8 +117,8 @@ $(function() { var hits = {}; files.forEach(function(file) { ++hits[file.name] || (hits[file.name] = 0); - var row = $($('li[data-filename="' + escape(file.name) + '"]') + - [hits[file.name] || 0]); + var row = $($('li[data-filename="' + + escape(file.name) + '"]')[hits[file.name] || 0]); fn.call(row, row, file, files); }); }; -- cgit v1.2.3 From 84c62ccee752448db9cf277595e88ecb340d189b Mon Sep 17 00:00:00 2001 From: Eliot Whalan Date: Thu, 24 Sep 2015 18:05:55 +1000 Subject: Fix indentation to 2 spaces to comply with airbnb https://github.com/airbnb/javascript --- js/pomf.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/pomf.js b/js/pomf.js index c2e6264..10c36cf 100644 --- a/js/pomf.js +++ b/js/pomf.js @@ -118,7 +118,7 @@ $(function() { files.forEach(function(file) { ++hits[file.name] || (hits[file.name] = 0); var row = $($('li[data-filename="' + - escape(file.name) + '"]')[hits[file.name] || 0]); + escape(file.name) + '"]')[hits[file.name] || 0]); fn.call(row, row, file, files); }); }; -- cgit v1.2.3 From 8425a1bd357dfcdfd97e63f9c3ef612867a4b890 Mon Sep 17 00:00:00 2001 From: Eliot Whalan Date: Thu, 24 Sep 2015 18:15:14 +1000 Subject: Remove code that requires moe panel --- static/upload.php | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/static/upload.php b/static/upload.php index c501acd..4549373 100644 --- a/static/upload.php +++ b/static/upload.php @@ -135,18 +135,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); -- cgit v1.2.3 From 8fb40f409adc557fbab1cf24b2e32879fa3a8aaf Mon Sep 17 00:00:00 2001 From: Juuso Lapinlampi Date: Sun, 27 Sep 2015 12:50:49 +0000 Subject: Remove session_start(); from upload.php Moe panel uses PHP sessions to keep the user logged in. We don't need it anymore, it's not required for core functionality. --- static/upload.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/static/upload.php b/static/upload.php index 4549373..3d90a4f 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'; -- cgit v1.2.3