xmlrpc_value_calculate_type() fails for empty arrays

ax - October 15, 2005 - 23:25
Project:Drupal
Version:x.y.z
Component:base system
Category:bug report
Priority:critical
Assigned:Unassigned
Status:closed
Description

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!

AttachmentSize
xmlrpc_8.patch2.83 KB

#1

chx - October 16, 2005 - 04:09
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.

#2

ax - October 16, 2005 - 12:38
Status:needs work» needs review

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

AttachmentSize
xmlrpc_9.patch 2.87 KB

#3

ax - October 26, 2005 - 06:09

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

#4

chx - October 26, 2005 - 06:38
Status:needs review» reviewed & tested by the community

#5

Dries - October 28, 2005 - 13:14
Status:reviewed & tested by the community» fixed

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

#6

Anonymous - November 11, 2005 - 13:20
Status:fixed» closed
 
 

Drupal is a registered trademark of Dries Buytaert.