Skip to content

Commit

Permalink
#9253 Require User when handling announcement image upload
Browse files Browse the repository at this point in the history
  • Loading branch information
NateWr authored and asmecher committed Nov 8, 2023
1 parent 0f04c23 commit f90977a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions classes/announcement/Repository.php
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ protected function handleImageUpload(Announcement $announcement): void
$temporaryFileManager = new TemporaryFileManager();
$temporaryFile = $temporaryFileManager->getFile((int) $image['temporaryFileId'], $user?->getId());
$filePath = $this->getImageSubdirectory() . '/' . $this->getImageFilename($announcement, $temporaryFile);
if ($this->storeTemporaryFile($temporaryFile, $filePath, $user?->getId(), $announcement)) {
if ($this->storeTemporaryFile($temporaryFile, $filePath, $user->getId(), $announcement)) {
$announcement->setImage(
$this->getImageData($announcement, $temporaryFile)
);
Expand All @@ -248,7 +248,7 @@ protected function handleImageUpload(Announcement $announcement): void
* @param string $newPath The new filename with the path relative to the public files directoruy
* @return bool Whether or not the operation was successful
*/
protected function storeTemporaryFile(TemporaryFile $temporaryFile, string $newPath, ?int $userId, Announcement $announcement): bool
protected function storeTemporaryFile(TemporaryFile $temporaryFile, string $newPath, int $userId, Announcement $announcement): bool
{
$publicFileManager = new PublicFileManager();
$temporaryFileManager = new TemporaryFileManager();
Expand Down

0 comments on commit f90977a

Please sign in to comment.