Opened 15 years ago
Closed 14 years ago
#10665 closed defect (bug) (fixed)
Protect XMLRPC against failures when WP_DEBUG enabled
Reported by: | redsweater | Owned by: | westi |
---|---|---|---|
Milestone: | 3.1 | Priority: | normal |
Severity: | normal | Version: | |
Component: | XML-RPC | Keywords: | has-patch |
Focuses: | Cc: |
Description
Further protections for xmlrpc.php to guard against errors that are printed when WP_DEBUG is enabled.
The attached patch protects against failures that occur when the optional parameters for enclosures, categories, and ping urls are omitted by the client.
Attachments (2)
Change History (10)
Note: See
TracTickets for help on using
tickets.
I altered the patch to be especially careful that the variables being initialized are set to the same default values they would have received previously. In particular, the problematic array lookups yield initial values of NULL, which I now set explicitly as the fallback value in case the array items don't exist.
I switched from using "!empty" to "isset", so that the logic is identical to before: if the array element is set at all, it is used to initialize the variable. If it's not set, then NULL is used. For categories, an empty array is the default initialized value, which matches previous behavior as well.