@@ -104,7 +104,7 @@ static void set_ns_and_type(xmlNodePtr node, encodeTypePtr type);
104
104
return zval; \
105
105
} \
106
106
if (xml->properties) { \
107
- null = get_attribute (xml->properties, "nil"); \
107
+ null = get_attribute_ex (xml->properties, "nil", XSI_NAMESPACE ); \
108
108
if (null) { \
109
109
ZVAL_NULL(zval); \
110
110
return zval; \
@@ -287,13 +287,7 @@ static bool soap_check_zval_ref(zval *data, xmlNodePtr node) {
287
287
return 0 ;
288
288
}
289
289
if (SOAP_GLOBAL (soap_version ) == SOAP_1_1 ) {
290
- while (1 ) {
291
- attr = get_attribute (attr , "id" );
292
- if (attr == NULL || attr -> ns == NULL ) {
293
- break ;
294
- }
295
- attr = attr -> next ;
296
- }
290
+ attr = get_attribute (attr , "id" );
297
291
if (attr ) {
298
292
id = (char * )attr -> children -> content ;
299
293
smart_str_appendc (& prefix , '#' );
@@ -1530,7 +1524,7 @@ static zval *to_zval_object_ex(zval *ret, encodeTypePtr type, xmlNodePtr data, z
1530
1524
1531
1525
ZEND_HASH_FOREACH_PTR (sdlType -> attributes , attr ) {
1532
1526
if (attr -> name ) {
1533
- xmlAttrPtr val = get_attribute (data -> properties , attr -> name );
1527
+ xmlAttrPtr val = get_attribute_any_ns (data -> properties , attr -> name );
1534
1528
char * str_val = NULL ;
1535
1529
1536
1530
if (val && val -> children && val -> children -> content ) {
@@ -2485,6 +2479,26 @@ static xmlNodePtr to_xml_array(encodeTypePtr type, zval *data, int style, xmlNod
2485
2479
return xmlParam ;
2486
2480
}
2487
2481
2482
+ static xmlAttrPtr get_soap_1_1_enc_attribute (xmlAttrPtr props , const char * name )
2483
+ {
2484
+ return get_attribute_ex (props , name , SOAP_1_1_ENC_NAMESPACE );
2485
+ }
2486
+
2487
+ static xmlAttrPtr get_soap_1_2_enc_attribute (xmlAttrPtr props , const char * name )
2488
+ {
2489
+ return get_attribute_ex (props , name , SOAP_1_2_ENC_NAMESPACE );
2490
+ }
2491
+
2492
+ /* Be forgiving for BC */
2493
+ static xmlAttrPtr get_soap_enc_attribute (xmlAttrPtr props , const char * name )
2494
+ {
2495
+ xmlAttrPtr res = get_soap_1_1_enc_attribute (props , name );
2496
+ if (!res ) {
2497
+ res = get_soap_1_2_enc_attribute (props , name );
2498
+ }
2499
+ return res ;
2500
+ }
2501
+
2488
2502
static zval * to_zval_array (zval * ret , encodeTypePtr type , xmlNodePtr data )
2489
2503
{
2490
2504
xmlNodePtr trav ;
@@ -2501,7 +2515,7 @@ static zval *to_zval_array(zval *ret, encodeTypePtr type, xmlNodePtr data)
2501
2515
FIND_XML_NULL (data , ret );
2502
2516
2503
2517
if (data &&
2504
- (attr = get_attribute (data -> properties ,"arrayType" )) &&
2518
+ (attr = get_soap_enc_attribute (data -> properties ,"arrayType" )) &&
2505
2519
attr -> children && attr -> children -> content ) {
2506
2520
const char * type ;
2507
2521
char * end , * ns ;
@@ -2521,7 +2535,7 @@ static zval *to_zval_array(zval *ret, encodeTypePtr type, xmlNodePtr data)
2521
2535
}
2522
2536
if (ns ) {efree (ns );}
2523
2537
2524
- } else if ((attr = get_attribute (data -> properties ,"itemType" )) &&
2538
+ } else if ((attr = get_soap_enc_attribute (data -> properties ,"itemType" )) &&
2525
2539
attr -> children &&
2526
2540
attr -> children -> content ) {
2527
2541
const char * type ;
@@ -2535,7 +2549,7 @@ static zval *to_zval_array(zval *ret, encodeTypePtr type, xmlNodePtr data)
2535
2549
}
2536
2550
if (ns ) {efree (ns );}
2537
2551
2538
- if ((attr = get_attribute (data -> properties ,"arraySize" )) &&
2552
+ if ((attr = get_soap_enc_attribute (data -> properties ,"arraySize" )) &&
2539
2553
attr -> children && attr -> children -> content ) {
2540
2554
dimension = calc_dimension_12 ((char * )attr -> children -> content );
2541
2555
dims = get_position_12 (dimension , (char * )attr -> children -> content );
@@ -2544,7 +2558,7 @@ static zval *to_zval_array(zval *ret, encodeTypePtr type, xmlNodePtr data)
2544
2558
* dims = 0 ;
2545
2559
}
2546
2560
2547
- } else if ((attr = get_attribute (data -> properties ,"arraySize" )) &&
2561
+ } else if ((attr = get_soap_enc_attribute (data -> properties ,"arraySize" )) &&
2548
2562
attr -> children && attr -> children -> content ) {
2549
2563
2550
2564
dimension = calc_dimension_12 ((char * )attr -> children -> content );
@@ -2623,7 +2637,7 @@ static zval *to_zval_array(zval *ret, encodeTypePtr type, xmlNodePtr data)
2623
2637
pos = safe_emalloc (sizeof (int ), dimension , 0 );
2624
2638
memset (pos ,0 ,sizeof (int )* dimension );
2625
2639
if (data &&
2626
- (attr = get_attribute (data -> properties ,"offset" )) &&
2640
+ (attr = get_soap_enc_attribute (data -> properties ,"offset" )) &&
2627
2641
attr -> children && attr -> children -> content ) {
2628
2642
char * tmp = strrchr ((char * )attr -> children -> content ,'[' );
2629
2643
@@ -2639,7 +2653,7 @@ static zval *to_zval_array(zval *ret, encodeTypePtr type, xmlNodePtr data)
2639
2653
if (trav -> type == XML_ELEMENT_NODE ) {
2640
2654
int i ;
2641
2655
zval tmpVal , * ar ;
2642
- xmlAttrPtr position = get_attribute (trav -> properties ,"position" );
2656
+ xmlAttrPtr position = get_soap_enc_attribute (trav -> properties ,"position" );
2643
2657
2644
2658
ZVAL_NULL (& tmpVal );
2645
2659
master_to_zval (& tmpVal , enc , trav );
@@ -2854,9 +2868,9 @@ static zval *guess_zval_convert(zval *ret, encodeTypePtr type, xmlNodePtr data)
2854
2868
/* Logic: has children = IS_OBJECT else IS_STRING */
2855
2869
xmlNodePtr trav ;
2856
2870
2857
- if (get_attribute (data -> properties , "arrayType" ) ||
2858
- get_attribute (data -> properties , "itemType" ) ||
2859
- get_attribute (data -> properties , "arraySize" )) {
2871
+ if (get_soap_enc_attribute (data -> properties , "arrayType" ) ||
2872
+ get_soap_enc_attribute (data -> properties , "itemType" ) ||
2873
+ get_soap_enc_attribute (data -> properties , "arraySize" )) {
2860
2874
enc = get_conversion (SOAP_ENC_ARRAY );
2861
2875
} else {
2862
2876
enc = get_conversion (XSD_STRING );
@@ -3340,14 +3354,7 @@ xmlNodePtr sdl_guess_convert_xml(encodeTypePtr enc, zval *data, int style, xmlNo
3340
3354
static xmlNodePtr check_and_resolve_href (xmlNodePtr data )
3341
3355
{
3342
3356
if (data && data -> properties ) {
3343
- xmlAttrPtr href ;
3344
-
3345
- href = data -> properties ;
3346
- while (1 ) {
3347
- href = get_attribute (href , "href" );
3348
- if (href == NULL || href -> ns == NULL ) {break ;}
3349
- href = href -> next ;
3350
- }
3357
+ xmlAttrPtr href = get_attribute (data -> properties , "href" );
3351
3358
if (href ) {
3352
3359
/* Internal href try and find node */
3353
3360
if (href -> children -> content [0 ] == '#' ) {
0 commit comments