Opened 7 weeks ago
Last modified 6 weeks ago
#8218 new defect (bug)
Set_Plugin_Project - validate JSON via json_validate()
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Component: | Translate Site & Plugins | Keywords: | has-patch |
| Cc: |
Description
Currently, Set Plugin checks if the API response is valid JSON by looking at the first character ($json && '{' == $json[0]).
If the API response starts with a simple space, a new line, or a hidden character the check fails. It will reject the data, even if the JSON is fine.
Change History (2)
This ticket was mentioned in PR #592 on WordPress/wordpress.org by @timse201.
7 weeks ago
#1
- Keywords has-patch added
Note: See
TracTickets for help on using
tickets.
fixes: https://meta.trac.wordpress.org/ticket/8218
Replaces the manual string check with PHP 8.3 native json_validate() function.