The check to make sure a parameter is present is:

if (!is_numeric($args[$key]) && empty($args[$key]))

That rejects empty arrays. Using isset instead seems to give the right behavior. Patch attached.

CommentFileSizeAuthor
services_emptyarray.patch555 bytesscottgifford

Comments

marcingy’s picture

Status: Needs review » Postponed (maintainer needs more info)

hmm head for d5 has a different conditional to this patch

if (!is_numeric($args[$key]) && !is_array($args[$key]) && !is_bool($args[$key]) && empty($args[$key])) {

Which I believe resolves this issue.

scottgifford’s picture

It does seem to fix the empty array issue, thanks! The conditional in d5 head still rejects empty strings, though, while the conditional in the patch will allow them.

I'm not sure which behavior is correct, and I'm not really an expert in XML-RPC, but it seems to me there should be some way to pass empty strings.

marcingy’s picture

Head has a different conditional check from 5.0.92 which is the check detailed above. If that works then I believe we can close this issue otherwise there is a different issue at play. I only noticed because your patch wouldn't apply to head.

scottgifford’s picture

Hi marcingy, the code you pasted in rejects empty strings, but is otherwise OK. Using isset will allow empty strings. That was the only difference I could find between the two.

Thanks!

marcingy’s picture

Status: Postponed (maintainer needs more info) » Fixed

Also applied to 6-x-2-dev.

marcingy’s picture

Status: Fixed » Closed (fixed)