Skip to content

Sideloaded image tmp files are not cleaned up #2216

@oxyc

Description

@oxyc

Expected behavior

After having sideloaded an external image, the temporary file created by download_url should be deleted.

Timber downloads the image using download_url here https://github.com/timber/timber/blob/1.15.1/lib/ImageHelper.php#L376. If you read the docs of the function, it says:

Please note that the calling function must unlink() the file.

This is never done and should be added below this line https://github.com/timber/timber/blob/1.15.1/lib/ImageHelper.php#L388.

Actual behavior

Temporary files are never deleted.

Steps to reproduce behavior

Sorry, i dont have a real example at the moment but I can come back to this issue and update this later.

What version of WordPress, PHP and Timber are you using?

PHP 7.2
Timber: master

How did you install Timber? (for example, from GitHub, Composer/Packagist, WP.org?)

Github

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issuehelp wantedDo you know computer? Then lend a hand and have your code live in infamy!

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions