Skip to content
This repository was archived by the owner on Mar 3, 2020. It is now read-only.
This repository was archived by the owner on Mar 3, 2020. It is now read-only.

Attachments corrupted when downloading #617

@jnwarp

Description

@jnwarp

When downloading a file, the file appears broken on certain files. This is because the file size is being appended to the file when downloading.

Steps to reproduce:

  1. Upload an attachment as a text file
  2. Download attachment through challenge
  3. Look at the downloaded file, there is a number appended.

Screenshot:

Problematic code:
src/data/attachments.php

$data = readfile(Attachment::attachmentsDir.$filename);

The read file function appends the length to the end of the file. Instead it should be replaced with file_get_contents.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions