dmitry Wed May 2 08:22:32 2007 UTC Modified files: /php-src/ext/soap php_encoding.c soap.c /php-src/ext/soap/tests/bugs bug41097.phpt /php-src/ext/soap/tests/interop/Round3/GroupD r3_groupD_compound2_001w.phpt Log: Fixed bug #41097 (ext/soap returning associative array as indexed without using WSDL) http://cvs.php.net/viewvc.cgi/php-src/ext/soap/php_encoding.c?r1=1.157&r2=1.158&diff_format=u Index: php-src/ext/soap/php_encoding.c diff -u php-src/ext/soap/php_encoding.c:1.157 php-src/ext/soap/php_encoding.c:1.158 --- php-src/ext/soap/php_encoding.c:1.157 Mon Apr 2 13:43:29 2007 +++ php-src/ext/soap/php_encoding.c Wed May 2 08:22:32 2007 @@ -17,7 +17,7 @@ | Dmitry Stogov <[EMAIL PROTECTED]> | +----------------------------------------------------------------------+ */ -/* $Id: php_encoding.c,v 1.157 2007/04/02 13:43:29 dmitry Exp $ */ +/* $Id: php_encoding.c,v 1.158 2007/05/02 08:22:32 dmitry Exp $ */ #include <time.h> @@ -3345,8 +3345,12 @@ int i, count = zend_hash_num_elements(Z_ARRVAL_P(array)); zend_hash_internal_pointer_reset(Z_ARRVAL_P(array)); - for (i = 0;i < count;i++) { - if (zend_hash_get_current_key_type(Z_ARRVAL_P(array)) != HASH_KEY_IS_LONG) { + for (i = 0; i < count; i++) { + zstr str_index; + ulong num_index; + + if (zend_hash_get_current_key(Z_ARRVAL_P(array), &str_index, &num_index, 0) != HASH_KEY_IS_LONG || + num_index != i) { return TRUE; } zend_hash_move_forward(Z_ARRVAL_P(array)); http://cvs.php.net/viewvc.cgi/php-src/ext/soap/soap.c?r1=1.221&r2=1.222&diff_format=u Index: php-src/ext/soap/soap.c diff -u php-src/ext/soap/soap.c:1.221 php-src/ext/soap/soap.c:1.222 --- php-src/ext/soap/soap.c:1.221 Mon Apr 2 13:43:29 2007 +++ php-src/ext/soap/soap.c Wed May 2 08:22:32 2007 @@ -17,7 +17,7 @@ | Dmitry Stogov <[EMAIL PROTECTED]> | +----------------------------------------------------------------------+ */ -/* $Id: soap.c,v 1.221 2007/04/02 13:43:29 dmitry Exp $ */ +/* $Id: soap.c,v 1.222 2007/05/02 08:22:32 dmitry Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -853,6 +853,8 @@ REGISTER_LONG_CONSTANT("XSD_ANYTYPE", XSD_ANYTYPE, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("XSD_ANYXML", XSD_ANYXML, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("APACHE_MAP", APACHE_MAP, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("SOAP_ENC_OBJECT", SOAP_ENC_OBJECT, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("SOAP_ENC_ARRAY", SOAP_ENC_ARRAY, CONST_CS | CONST_PERSISTENT); http://cvs.php.net/viewvc.cgi/php-src/ext/soap/tests/bugs/bug41097.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/ext/soap/tests/bugs/bug41097.phpt diff -u /dev/null php-src/ext/soap/tests/bugs/bug41097.phpt:1.2 --- /dev/null Wed May 2 08:22:32 2007 +++ php-src/ext/soap/tests/bugs/bug41097.phpt Wed May 2 08:22:32 2007 @@ -0,0 +1,27 @@ +--TEST-- +Bug #41097 (ext/soap returning associative array as indexed without using WSDL) +--SKIPIF-- +<?php require_once('skipif.inc'); ?> +--FILE-- +<?php +function test($soap, $array) { + $soap->test($array); + echo (strpos($soap->__getLastRequest(), ':Map"') != false)?"Map\n":"Array\n"; +} + + +$soap = new SoapClient(null, array('uri' => 'http://uri/', 'location' => 'test://', 'exceptions' => 0, 'trace' => 1)); +test($soap, array('Foo', 'Bar')); +test($soap, array(5 => 'Foo', 10 => 'Bar')); +test($soap, array('5' => 'Foo', '10' => 'Bar')); +$soap->test(new SoapVar(array('Foo', 'Bar'), APACHE_MAP)); +echo (strpos($soap->__getLastRequest(), ':Map"') != false)?"Map\n":"Array\n"; +$soap->test(new SoapVar(array('Foo', 'Bar'), SOAP_ENC_ARRAY)); +echo (strpos($soap->__getLastRequest(), ':Map"') != false)?"Map\n":"Array\n"; +?> +--EXPECT-- +Array +Map +Map +Map +Array http://cvs.php.net/viewvc.cgi/php-src/ext/soap/tests/interop/Round3/GroupD/r3_groupD_compound2_001w.phpt?r1=1.3&r2=1.4&diff_format=u Index: php-src/ext/soap/tests/interop/Round3/GroupD/r3_groupD_compound2_001w.phpt diff -u php-src/ext/soap/tests/interop/Round3/GroupD/r3_groupD_compound2_001w.phpt:1.3 php-src/ext/soap/tests/interop/Round3/GroupD/r3_groupD_compound2_001w.phpt:1.4 --- php-src/ext/soap/tests/interop/Round3/GroupD/r3_groupD_compound2_001w.phpt:1.3 Tue Dec 19 11:55:16 2006 +++ php-src/ext/soap/tests/interop/Round3/GroupD/r3_groupD_compound2_001w.phpt Wed May 2 08:22:32 2007 @@ -31,7 +31,7 @@ ?> --EXPECT-- <?xml version="1.0" encoding="UTF-8"?> -<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/person" xmlns:ns2="http://soapinterop.org/employee"><SOAP-ENV:Body><ns2:x_Employee><ns2:person><ns1:Name>Shane</ns1:Name><ns1:Male>true</ns1:Male></ns2:person><ns2:salary>1.0E+6</ns2:salary><ns2:ID>12345</ns2:ID></ns2:x_Employee></SOAP-ENV:Body></SOAP-ENV:Envelope> +<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/person" xmlns:ns2="http://soapinterop.org/employee"><SOAP-ENV:Body><ns2:x_Employee><ns2:person><ns1:Name>Shane</ns1:Name><ns1:Male>true</ns1:Male></ns2:person><ns2:salary>1000000</ns2:salary><ns2:ID>12345</ns2:ID></ns2:x_Employee></SOAP-ENV:Body></SOAP-ENV:Envelope> <?xml version="1.0" encoding="UTF-8"?> -<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/person" xmlns:ns2="http://soapinterop.org/employee"><SOAP-ENV:Body><ns2:result_Employee><ns2:person><ns1:Name>Shane</ns1:Name><ns1:Male>true</ns1:Male></ns2:person><ns2:salary>1.0E+6</ns2:salary><ns2:ID>12345</ns2:ID></ns2:result_Employee></SOAP-ENV:Body></SOAP-ENV:Envelope> +<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/person" xmlns:ns2="http://soapinterop.org/employee"><SOAP-ENV:Body><ns2:result_Employee><ns2:person><ns1:Name>Shane</ns1:Name><ns1:Male>true</ns1:Male></ns2:person><ns2:salary>1000000</ns2:salary><ns2:ID>12345</ns2:ID></ns2:result_Employee></SOAP-ENV:Body></SOAP-ENV:Envelope> ok
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php