Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[DomCrawler] phpFiles array is generated wrongly for fields with more than one level #14021

Closed
@albe

Description

@albe

Symfony DomCrawler is broken for file uploads. It creates a wrongly formatted phpFiles array, when the submit field has more than one level, e.g. "post[upload]" will create

    array(1) {
      ["post"]=>
      array(1) {
        ["upload"]=>
        array(5) {
          ["name"]=>
          string(0) ""
          ["type"]=>
          string(0) ""
          ["tmp_name"]=>
          string(0) ""
          ["error"]=>
          string(1) "0"
          ["size"]=>
          string(1) "0"
        }
      }
    }

instead of the expected that PHP creates

    array(1) {
      ["post"]=>
      array(5) {
        ["name"]=>
        array(1) {
          ["upload"]=>
          string(13) ""
        }
        ["type"]=>
        array(1) {
          ["upload"]=>
          string(15) ""
        }
        ["tmp_name"]=>
        array(1) {
          ["upload"]=>
          string(27) ""
        }
        ["error"]=>
        array(1) {
          ["upload"]=>int(0)
        }
        ["size"]=>
        array(1) {
          ["upload"]=>
          int(0)
        }
      }
    }

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions