Skip to content

[NFR] Phalcon\Http\Request::hasFiles() returns true, when no files were sent #511

@alvassin

Description

@alvassin

How to reproduce:

Prepare form with enctype multipart/form-data and 1 input="file" field.
Then send the form without files.

var_dump($_FILES);
// outputs
array(1) {
  ["file"]=>
  array(5) {
    ["name"]=>
    string(0) ""
    ["type"]=>
    string(0) ""
    ["tmp_name"]=>
    string(0) ""
    ["error"]=>
    int(4)
    ["size"]=>
    int(0)
  }

// controller action context
var_dump($this->request->hasFiles()) // true

In fact, no files were transferred.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions