WordPress.org

Make WordPress Core

Opened 6 years ago

Last modified 11 months ago

#16980 reopened defect (bug)

Empty Values are converted to null by class-ixr.php — at Version 4

Reported by: nprasath002 Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version: 3.1
Component: XML-RPC Keywords: has-patch
Focuses: Cc:

Description (last modified by aaroncampbell)

I tried to fix the following bug #10599
Found out when you send and empty value via xmlrpc it converts it to null value.

Say you send and array of arguments for mw_editpost, set

$content_struct[mt_keywords] = '';


IXR client passes a null value instead of an empty value.

In mw_post method consider this statement

$tags_input = isset( $content_struct[mt_keywords] ) ? $content_struct[mt_keywords] : null;

Even if you send an empty value this statement fails because

$content_struct[mt_keywords]


is set to null by IXR client.

Change History (4)

#1 @nprasath002
6 years ago

I tried to fix the following bug
http://core.trac.wordpress.org/ticket/10599
Found out when you send and empty value via xmlrpc it converts it to null value.

Say you send and array of arguments for mw_editpost, set

$content_struct[mt_keywords] = '';


IXR client passes a null value instead of an empty value.

In mw_post method consider this statement

$tags_input = isset( $content_struct[mt_keywords] ) ? $content_struct[mt_keywords] : null;

Even if you send an empty value this statement fails because

$content_struct[mt_keywords]


is set to null by IXR client.

Last edited 6 years ago by nprasath002 (previous) (diff)

#2 follow-up: @ocean90
6 years ago

  • Description modified (diff)

Copied from the comment.

#3 in reply to: ↑ 2 @nprasath002
6 years ago

Replying to ocean90:

Copied from the comment.

I edited again. Fix that in the description

$tags_input = isset( $content_struct[mt_keywords] ) ? $content_struct[mt_keywords] : null;

P.S how can i edit the decription??

#4 @aaroncampbell
6 years ago

  • Description modified (diff)

Updated the code in description.

nprasath002: I'm not sure exactly how the permissions are set up, but I do know that not everyone can change a ticket description.

Note: See TracTickets for help on using tickets.