Opened 5 months ago
Last modified 4 months ago
#8218 new defect (bug)
Set_Plugin_Project - validate JSON via json_validate()
| Reported by: | timse201 | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| 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.
5 months ago
#1
- Keywords has-patch added
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
fixes: https://meta.trac.wordpress.org/ticket/8218
Replaces the manual string check with PHP 8.3 native json_validate() function.