Opened 6 years ago
Last modified 5 years ago
#49905 accepted defect (bug)
Correct return type for xmlrpc_getposttitle() and xmlrpc_getpostcategory()
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | Future Release | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | XML-RPC | Keywords: | has-patch |
| Focuses: | Cc: |
Description
There are a few issues in xmlrpc_getposttitle() and xmlrpc_getpostcategory():
xmlrpc_getposttitle()uses the$post_default_titleglobal as a fallback title, however the global is only set inxmlrpc.phpand not in other contexts where the function might be called, e.g.wp-mail.php. In those cases, the function returnsnullinstead of a string, causing issues like #49853.xmlrpc_getpostcategory()uses the$post_default_categoryglobal, however it was removed in [2680]. Because of that, the function can also returnnull.xmlrpc_getpostcategory()documentation suggests that it returns either a string or an array of strings, however that is incorrect. It's supposed to be used for thepost_categoryparameter ofwp_insert_post(), which receives an array of numeric category IDs.
Let's bring some consistency and unit tests here.
Attachments (1)
Change History (14)
This ticket was mentioned in Slack in #core by hellofromtonya. View the logs.
5 years ago
This ticket was mentioned in Slack in #core by helen. View the logs.
5 years ago
This ticket was mentioned in Slack in #core by chaion07. View the logs.
5 years ago
#12
@
5 years ago
Upon reviewing this ticket during a [recent triage session]https://wordpress.slack.com/archives/C02RQBWTW/p1622577686161800 the team recommended that this can be punted for future release (not 5.9). Thanks
Note: See
TracTickets for help on using
tickets.
Related: #37096