[wp-trac] [WordPress Trac] #61061: PHP Warning with invalid JSON input
WordPress Trac
noreply at wordpress.org
Wed Jul 3 14:39:47 UTC 2024
#61061: PHP Warning with invalid JSON input
--------------------------+------------------------------
Reporter: dd32 | Owner: (none)
Type: defect (bug) | Status: new
Priority: low | Milestone: Awaiting Review
Component: REST API | Version:
Severity: normal | Resolution:
Keywords: has-patch | Focuses: rest-api
--------------------------+------------------------------
Comment (by antonvlasenko):
== Test Report
This report validates that the indicated patch addresses the issue.
Patch tested: https://github.com/WordPress/wordpress-develop/pull/6491
=== Environment
- WordPress: 6.6-beta3-58440-src
- PHP: 7.3.33
- Server: Apache/2.4.57 (Unix) PHP/7.3.33
- Database: mysqli (Server: 5.7.43 / Client: mysqlnd 5.0.12-dev)
- Browser: Safari 17.5 (macOS)
- Theme: Twenty Twenty-Four 1.1
- MU-Plugins: None activated
- Plugins:
* JSON Basic Authentication 0.1
=== Actual Results
- ✅ No error in the `debug.log` file after applying the patch.
=== Additional Notes
The curl request used for testing:
{{{
curl --user admin:password http://wordpress.test/wp-json/wp/v2/users/1
--data '1' -H 'Content-Type: application/json'
}}}
=== Supplemental Artifacts
Before applying the patch, the following error was recorded in the
`debug.log` file:
{{{
[03-Jul-2024 14:32:18 UTC] PHP Warning: Invalid argument supplied for
foreach() in /src/wp-includes/rest-api/class-wp-rest-request.php on line
816
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/61061#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list