diff --git a/public_html/media/js/upload.js b/public_html/media/js/upload.js index b4e7f15c..31273151 100644 --- a/public_html/media/js/upload.js +++ b/public_html/media/js/upload.js @@ -89,18 +89,12 @@ $(function() var postDom = posts.first(); var url = postDom.find('form').attr('action') + '?json'; - var sourceFile = postDom.data('file'); - var sourceUrl = postDom.data('url'); - var tags = postDom.find('[name=tags]').val(); - var safety = postDom.find('[name=safety]:checked').val(); - var source = postDom.find('[name=source]').val(); - var fd = new FormData(); - fd.append('file', sourceFile); - fd.append('url', sourceUrl); - fd.append('tags', tags); - fd.append('safety', safety); - fd.append('source', source); - fd.append('submit', 1); + console.log(postDom.find('form').get(0)); + var fd = new FormData(postDom.find('form').get(0)); + + fd.append('file', postDom.data('file')); + fd.append('url', postDom.data('url')); + var ajaxData = { diff --git a/src/Controllers/PostController.php b/src/Controllers/PostController.php index ed5f45cf..3f1ec428 100644 --- a/src/Controllers/PostController.php +++ b/src/Controllers/PostController.php @@ -318,7 +318,7 @@ class PostController $dbPost->upload_date = time(); $dbPost->image_width = $imageWidth; $dbPost->image_height = $imageHeight; - if ($this->context->loggedIn) + if ($this->context->loggedIn and !InputHelper::get('anonymous')) $dbPost->uploader = $this->context->user; $dbPost->ownFavoritee = []; $dbPost->sharedTag = $dbTags; diff --git a/src/Views/post-upload.phtml b/src/Views/post-upload.phtml index 35f324f2..9aae2a6f 100644 --- a/src/Views/post-upload.phtml +++ b/src/Views/post-upload.phtml @@ -101,6 +101,12 @@ + + +