Skip to content

$_FILES[...]['error'] should be int and not string #914

@TobiasBg

Description

@TobiasBg

In my plugin, I'm using UPLOAD_ERR_OK !== $_FILES['form-field-name']['error'] to check for issues with file uploads (from an <input type="file" name="form-field-name" /> in this example).

The UPLOAD_ERR_OK constant in PHP normally is an int, see https://3v4l.org/WjW2j .

However, in WordPress Playground, $_FILES['form-field-name']['error'] returns a string.

Maybe something in

// Set $_FILES['key']['error']
needs to be adjusted?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions