Opened 4 years ago
Closed 3 years ago
#10656 closed defect (bug) (fixed)
Creating or updating serialized custom field values via XML-RPC serializes them again
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | high | Milestone: | 2.9 |
| Component: | XML-RPC | Version: | 2.9 |
| Severity: | normal | Keywords: | has-patch tested |
| Cc: | xsewarx@… |
Description
If one creates or updates a page via XML-RPC and the page has custom fields with values that are PHP serialized strings, they will be silently corrupted by serializing them again. Other strings are unmodified.
Attachments (3)
Change History (8)
JonathanRogers — 4 years ago
- Cc xsewarx@… added
- Keywords has-patch tested added
- Priority changed from normal to high
I have faced the same problem, applied this patch and it worked very well. I will attach a python script that can be used to test this.
This script could be used to test XML-RPC functions of Wordpress, including post meta.
- Keywords tested removed
Actually the patch seems not working very well, will do more tests and update later.
- Keywords tested added
- Milestone changed from Unassigned to 2.9
- Version changed from 2.8.4 to 2.9
The bug is in using stripslashes and trim functions which returns strings, so they will convert any value to string (like arrays to "Array"). I have tested it with XML-RPC "metaWeblog.newPost" and worked very well.
comment:5
automattor — 3 years ago
- Resolution set to fixed
- Status changed from new to closed

Prevents XML-RPC server from re-serializing custom field values that are already serialized.