Media: Fix wp_show_heic_upload_error() assigning to an undeclared variable. - #12830
Media: Fix wp_show_heic_upload_error() assigning to an undeclared variable.#12830softglazee wants to merge 1 commit into
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
…iable. The function assigned the error flag to an undeclared $plupload_init variable instead of the $plupload_settings parameter, preventing the flag from reaching the returned array. This behavior was introduced in [58849] and shipped in WordPress 6.7.0. Adds unit tests covering both the supported and unsupported cases. See #65802.
a53c8ee to
13a5841
Compare
The
wp_show_heic_upload_error()function assigned the HEIC upload error flag to an undeclared$plupload_initvariable instead of the$plupload_settingsparameter. As a result, the flag never reached the returned array. This behavior was introduced in [58849] and shipped in WordPress 6.7.0.This patch updates the variable name to
$plupload_settingsso the flag is properly appended, and adds unit tests covering both the supported and unsupported HEIC editor cases.Testing Instructions
These tests were run on trunk
8c3c976c25using PHP 8.3.32 and PHPUnit 9.6.35.npm run test:php -- --filter test_wp_show_heic_upload_errorOK (2 tests, 7 assertions)src/wp-includes/media.phpto test the baseline failure:git stash push src/wp-includes/media.phpnpm run test:php -- --filter test_wp_show_heic_upload_error1) Tests_Media::test_wp_show_heic_upload_error_adds_flag_when_not_supportedFailed asserting that an array has the key 'heic_upload_error'.git stash popTrac ticket: https://core.trac.wordpress.org/ticket/65802
Use of AI Tools
Used for: Investigating the underlying code paths, structuring the PHPUnit test scaffolding, and generating shell commands for the environment. The initial finding, manual measurements, Trac ticket description, and commit message are my own work.