Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Form] Files upload is broken for PHP 8.1 because of new key full_path is added #46146

Copy link
Copy link
Closed
@p-golovin

Description

@p-golovin
Issue body actions

Symfony version(s) affected

5.4.7, 6.0.7, 6.1

Description

There is hardcoded array of keys for $_FILES in https://github.com/symfony/symfony/blob/5.4/src/Symfony/Component/Form/NativeRequestHandler.php.

It is checked against posted data in two cases:
https://github.com/symfony/symfony/blob/5.4/src/Symfony/Component/Form/NativeRequestHandler.php#L204
https://github.com/symfony/symfony/blob/5.4/src/Symfony/Component/Form/NativeRequestHandler.php#L240

In PHP 8.1 was added new key full_path (https://php.watch/versions/8.1/$_FILES-full-path). As a result check is broken and we get incorrect format of image's array at https://github.com/symfony/symfony/blob/5.4/src/Symfony/Component/Form/NativeRequestHandler.php#L93 and error that form contains not allowed extra fields.

image

How to reproduce

We use Form component as standalone without entire framework but within our cms. Problem looks obvious, but if it will be needed, I'll try to create code for reproduce problem.

Possible Solution

I've found that such problem was already fixed in HttpFoundation component: #42112

Additional Context

No response

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

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.