#20394 closed defect (bug) (fixed)
XMLRPC: notices for missing arguments
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 3.4 | Priority: | normal |
Severity: | normal | Version: | 3.4 |
Component: | XML-RPC | Keywords: | has-patch dev-feedback |
Focuses: | Cc: |
Description
When arguments aren't pass there is a big chance a notice get fired.
When someone uses WP_Debug this can mean the XMLRPC will break
Attachments (4)
Change History (15)
#1
@
13 years ago
I wonder if that patch is really the right approach.
It might be better to have a guard condition at the top of each method that checks that $args
is at least a minimum length. And if the guard fails, return a 400 status code error.
Sensible error messages help API consumers as well as prevent these PHP notices.
#3
@
13 years ago
Was first thinking about that. Looking into the code I think for all methods it should work. Probably some need discussion.
One issue need to be fixed and that is in wp_editPost. $post_more isn't set what causes a notice
#4
@
13 years ago
This is a first rough version of the guard condition version. A lot of unit test will fail since they also test if there are nog enough arguments passed.
#5
@
13 years ago
I could go for 20394.guard.diff but we should enforce this for new methods only.
#7
@
13 years ago
Added a refreshed patch that makes the method name a bit friendly and only applies to methods added in 3.4 for back-compat. I'm not sure whether we should make it cover the other wp.*
methods, but at least we should avoid adding it to the legacy method namespaces.
#8
@
13 years ago
- Owner set to nacin
- Resolution set to fixed
- Status changed from new to closed
In [20636]:
#9
@
13 years ago
- Resolution fixed deleted
- Status changed from closed to reopened
The patch, used spaces instead of tabs, and 4 spaces at that. I happened to notice that as a result the code looked poorly formatted with a config using an 8 space tab.
Upcoming patch switches to tabs instead of spaces.
$args checks changes for all the XMLRPC methods