Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

[Form] Fix merging form data and files (ter)#52347

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

@nicolas-grekas
Copy link
Member

QA
Branch?5.4
Bug fix?yes
New feature?no
Deprecations?no
IssuesFix#52318
LicenseMIT

Adapted from a patch provided by@jan-pintr

The original was like below but this one looks more appropriate to me.

--- a/src/Symfony/Component/Form/Util/FormUtil.php+++ b/src/Symfony/Component/Form/Util/FormUtil.php@@ -47,8 +47,12 @@ public static function isEmpty(mixed $data): bool     public static function mergeParamsAndFiles(array $params, array $files): array     {         if (array_is_list($files)) {-            foreach ($files as $value) {-                $params[] = $value;+            foreach ($files as $key => $value) {+                if (is_array($params[$key])) {+                    $params[$key] = array_merge($params[$key], $value);+                } else {+                    $params[] = $value;+                }             }              return $params;@@ -61,6 +65,6 @@ public static function mergeParamsAndFiles(array $params, array $files): array             }         }-        return array_replace($params, $files);+        return array_merge($params, $files);     }```</details>

@nicolas-grekasnicolas-grekasforce-pushed theform-zero-indexed-col-reproducer branch fromeedb07a to9facb2fCompareOctober 28, 2023 16:24
@fabpot
Copy link
Member

Thank you@nicolas-grekas.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@fabpotfabpotfabpot approved these changes

@ycerutoycerutoyceruto approved these changes

@xabbuhxabbuhAwaiting requested review from xabbuhxabbuh is a code owner

Assignees

No one assigned

Projects

None yet

Milestone

5.4

Development

Successfully merging this pull request may close these issues.

4 participants

@nicolas-grekas@fabpot@yceruto@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp