From 839e97b1e2cf327aba39ca10e5f10d72387131a6 Mon Sep 17 00:00:00 2001 From: Marcin Kurczewski Date: Sun, 14 Dec 2014 09:30:22 +0100 Subject: [PATCH] Fixed history for posts uploaded anonymously Until now posts uploaded anonymously were not so anonymous - the author was clearly visible in post history (and tag history if the upload has led to creation of any new tags). Both of these are fixed now. --- src/Services/PostService.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Services/PostService.php b/src/Services/PostService.php index eed27e86..4edbf48b 100644 --- a/src/Services/PostService.php +++ b/src/Services/PostService.php @@ -109,10 +109,13 @@ class PostService { $formData->validate($this->validator); + if ($formData->anonymous) + $this->authService->loginAnonymous(); + $post = new Post(); $post->setUploadTime($this->timeService->getCurrentTime()); $post->setLastEditTime($this->timeService->getCurrentTime()); - $post->setUser($formData->anonymous ? null : $this->authService->getLoggedInUser()); + $post->setUser($this->authService->getLoggedInUser()); $post->setOriginalFileName($formData->contentFileName); $post->setName($this->getUniqueRandomPostName());