Skip to content

Type error in FileUpload->getImageSize() #183

@dada-amater

Description

@dada-amater

Version: 3.0.4

Bug Description

$file->getImageSize() returns TypeError for the file is not an image. PHP function getimagesize() returns array|false, not array|null.
See https://github.com/nette/http/blob/master/src/Http/FileUpload.php#L191

Steps To Reproduce

Upload a file that is not image and ask for $file->getImageSize().

Expected Behavior

No TypeError.

Possible Solution

Retype result of PHP function getimagesize() from false to null.

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