patch for http://lists.drupal.org/archives/drupal-devel/2005-10/msg00386.html (in short: xmlrpc_value_calculate_type() wrongly returns 'struct' for empty arrays, which breaks blogapi-clients).

fix: return 'array' for empty arrays.

additionally:

* PHPDoc for xmlrpc_value_calculate_type()
* use is_*() instead of gettype() as advised in the PHP manual (and document this)
* coding style

please review and apply (to 4.5 and 4.6, too). thanks!

CommentFileSizeAuthor
#2 xmlrpc_9.patch2.87 KBax
xmlrpc_8.patch2.83 KBax
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

chx’s picture

Status: Active » Needs work

To get rid of gettype and use empty to check for empty arrays, that's good. But to get rid of that array key checker completely -- that's not. Because if I have an array('foo', 'bar', 'this' => 'that') it's a struct.

ax’s picture

Status: Needs work » Needs review
FileSize
2.87 KB

ah - thats what your range() was good for. allright - put it back in then.

ax’s picture

shouldn't blogapi-clients work in 4.7 (bump)?

chx’s picture

Status: Needs review » Reviewed & tested by the community
Dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to HEAD and DRUPAL-4-6. Thanks.

Anonymous’s picture

Status: Fixed » Closed (fixed)