@@ -1222,10 +1222,14 @@ PHP_METHOD(SoapServer, SoapServer)
1222
1222
1223
1223
SOAP_SERVER_BEGIN_CODE ();
1224
1224
1225
- if (zend_parse_parameters ( ZEND_NUM_ARGS () TSRMLS_CC , "z! |a" , & wsdl , & options ) == FAILURE ) {
1226
- return ;
1225
+ if (zend_parse_parameters_ex ( ZEND_PARSE_PARAMS_QUIET , ZEND_NUM_ARGS () TSRMLS_CC , "z|a" , & wsdl , & options ) == FAILURE ) {
1226
+ php_error_docref ( NULL TSRMLS_CC , E_ERROR , " Invalid parameters ") ;
1227
1227
}
1228
1228
1229
+ if (Z_TYPE_P (wsdl ) != IS_STRING && Z_TYPE_P (wsdl ) != IS_NULL ) {
1230
+ php_error_docref (NULL TSRMLS_CC , E_ERROR , "Invalid parameters ");
1231
+ }
1232
+
1229
1233
service = emalloc (sizeof (soapService ));
1230
1234
memset (service , 0 , sizeof (soapService ));
1231
1235
service -> send_errors = 1 ;
@@ -1246,9 +1250,8 @@ PHP_METHOD(SoapServer, SoapServer)
1246
1250
if (zend_hash_find (ht , "uri" , sizeof ("uri" ), (void * * )& tmp ) == SUCCESS &&
1247
1251
Z_TYPE_PP (tmp ) == IS_STRING ) {
1248
1252
service -> uri = estrndup (Z_STRVAL_PP (tmp ), Z_STRLEN_PP (tmp ));
1249
- } else if (wsdl == NULL ) {
1250
- php_error_docref (NULL TSRMLS_CC , E_WARNING , "'uri' option is required in nonWSDL mode" );
1251
- return ;
1253
+ } else if (Z_TYPE_P (wsdl ) == IS_NULL ) {
1254
+ php_error_docref (NULL TSRMLS_CC , E_ERROR , "'uri' option is required in nonWSDL mode" );
1252
1255
}
1253
1256
1254
1257
if (zend_hash_find (ht , "actor" , sizeof ("actor" ), (void * * )& tmp ) == SUCCESS &&
@@ -1262,8 +1265,7 @@ PHP_METHOD(SoapServer, SoapServer)
1262
1265
1263
1266
encoding = xmlFindCharEncodingHandler (Z_STRVAL_PP (tmp ));
1264
1267
if (encoding == NULL ) {
1265
- php_error_docref (NULL TSRMLS_CC , E_WARNING , "Invalid 'encoding' option - '%s'" , Z_STRVAL_PP (tmp ));
1266
- return ;
1268
+ php_error_docref (NULL TSRMLS_CC , E_ERROR , "Invalid 'encoding' option - '%s'" , Z_STRVAL_PP (tmp ));
1267
1269
} else {
1268
1270
service -> encoding = encoding ;
1269
1271
}
@@ -1299,9 +1301,8 @@ PHP_METHOD(SoapServer, SoapServer)
1299
1301
service -> send_errors = Z_LVAL_PP (tmp );
1300
1302
}
1301
1303
1302
- } else if (wsdl == NULL ) {
1303
- php_error_docref (NULL TSRMLS_CC , E_WARNING , "'uri' option is required in nonWSDL mode" );
1304
- return ;
1304
+ } else if (Z_TYPE_P (wsdl ) == IS_NULL ) {
1305
+ php_error_docref (NULL TSRMLS_CC , E_ERROR , "'uri' option is required in nonWSDL mode" );
1305
1306
}
1306
1307
1307
1308
service -> version = version ;
@@ -1310,7 +1311,7 @@ PHP_METHOD(SoapServer, SoapServer)
1310
1311
service -> soap_functions .ft = emalloc (sizeof (HashTable ));
1311
1312
zend_hash_init (service -> soap_functions .ft , 0 , NULL , ZVAL_PTR_DTOR , 0 );
1312
1313
1313
- if (wsdl ) {
1314
+ if (Z_TYPE_P ( wsdl ) != IS_NULL ) {
1314
1315
service -> sdl = get_sdl (this_ptr , Z_STRVAL_P (wsdl ), cache_wsdl TSRMLS_CC );
1315
1316
if (service -> uri == NULL ) {
1316
1317
if (service -> sdl -> target_ns ) {
@@ -2501,8 +2502,7 @@ PHP_FUNCTION(is_soap_fault)
2501
2502
PHP_METHOD (SoapClient , SoapClient )
2502
2503
{
2503
2504
2504
- zval * wsdl ;
2505
- zval * options = NULL ;
2505
+ zval * wsdl , * options = NULL ;
2506
2506
int soap_version = SOAP_1_1 ;
2507
2507
php_stream_context * context = NULL ;
2508
2508
long cache_wsdl ;
@@ -2511,16 +2511,12 @@ PHP_METHOD(SoapClient, SoapClient)
2511
2511
2512
2512
SOAP_CLIENT_BEGIN_CODE ();
2513
2513
2514
- if (zend_parse_parameters ( ZEND_NUM_ARGS () TSRMLS_CC , "z|a" , & wsdl , & options ) == FAILURE ) {
2515
- return ;
2514
+ if (zend_parse_parameters_ex ( ZEND_PARSE_PARAMS_QUIET , ZEND_NUM_ARGS () TSRMLS_CC , "z|a" , & wsdl , & options ) == FAILURE ) {
2515
+ php_error_docref ( NULL TSRMLS_CC , E_ERROR , " Invalid parameters ") ;
2516
2516
}
2517
2517
2518
- if (Z_TYPE_P (wsdl ) == IS_STRING ) {
2519
- } else if (Z_TYPE_P (wsdl ) != IS_NULL ) {
2520
- php_error_docref (NULL TSRMLS_CC , E_WARNING , "$wsdl must be string or null" );
2521
- return ;
2522
- } else {
2523
- wsdl = NULL ;
2518
+ if (Z_TYPE_P (wsdl ) != IS_STRING && Z_TYPE_P (wsdl ) != IS_NULL ) {
2519
+ php_error_docref (NULL TSRMLS_CC , E_ERROR , "$wsdl must be string or null" );
2524
2520
}
2525
2521
2526
2522
cache_wsdl = SOAP_GLOBAL (cache );
@@ -2529,14 +2525,13 @@ PHP_METHOD(SoapClient, SoapClient)
2529
2525
HashTable * ht = Z_ARRVAL_P (options );
2530
2526
zval * * tmp ;
2531
2527
2532
- if (wsdl == NULL ) {
2528
+ if (Z_TYPE_P ( wsdl ) == IS_NULL ) {
2533
2529
/* Fetching non-WSDL mode options */
2534
2530
if (zend_hash_find (ht , "uri" , sizeof ("uri" ), (void * * )& tmp ) == SUCCESS &&
2535
2531
Z_TYPE_PP (tmp ) == IS_STRING ) {
2536
2532
add_property_stringl (this_ptr , "uri" , Z_STRVAL_PP (tmp ), Z_STRLEN_PP (tmp ), 1 );
2537
2533
} else {
2538
- php_error_docref (NULL TSRMLS_CC , E_WARNING , "'uri' option is required in nonWSDL mode" );
2539
- return ;
2534
+ php_error_docref (NULL TSRMLS_CC , E_ERROR , "'uri' option is required in nonWSDL mode" );
2540
2535
}
2541
2536
2542
2537
if (zend_hash_find (ht , "style" , sizeof ("style" ), (void * * )& tmp ) == SUCCESS &&
@@ -2560,9 +2555,8 @@ PHP_METHOD(SoapClient, SoapClient)
2560
2555
if (zend_hash_find (ht , "location" , sizeof ("location" ), (void * * )& tmp ) == SUCCESS &&
2561
2556
Z_TYPE_PP (tmp ) == IS_STRING ) {
2562
2557
add_property_stringl (this_ptr , "location" , Z_STRVAL_PP (tmp ), Z_STRLEN_PP (tmp ), 1 );
2563
- } else if (wsdl == NULL ) {
2564
- php_error_docref (NULL TSRMLS_CC , E_WARNING , "'location' option is required in nonWSDL mode" );
2565
- return ;
2558
+ } else if (Z_TYPE_P (wsdl ) == IS_NULL ) {
2559
+ php_error_docref (NULL TSRMLS_CC , E_ERROR , "'location' option is required in nonWSDL mode" );
2566
2560
}
2567
2561
2568
2562
if (zend_hash_find (ht , "soap_version" , sizeof ("soap_version" ), (void * * )& tmp ) == SUCCESS ) {
@@ -2638,8 +2632,7 @@ PHP_METHOD(SoapClient, SoapClient)
2638
2632
2639
2633
encoding = xmlFindCharEncodingHandler (Z_STRVAL_PP (tmp ));
2640
2634
if (encoding == NULL ) {
2641
- php_error_docref (NULL TSRMLS_CC , E_WARNING , "Invalid 'encoding' option - '%s'" , Z_STRVAL_PP (tmp ));
2642
- return ;
2635
+ php_error_docref (NULL TSRMLS_CC , E_ERROR , "Invalid 'encoding' option - '%s'" , Z_STRVAL_PP (tmp ));
2643
2636
} else {
2644
2637
xmlCharEncCloseFunc (encoding );
2645
2638
add_property_stringl (this_ptr , "_encoding" , Z_STRVAL_PP (tmp ), Z_STRLEN_PP (tmp ), 1 );
@@ -2690,15 +2683,13 @@ PHP_METHOD(SoapClient, SoapClient)
2690
2683
Z_TYPE_PP (tmp ) == IS_STRING ) {
2691
2684
add_property_stringl (this_ptr , "_user_agent" , Z_STRVAL_PP (tmp ), Z_STRLEN_PP (tmp ), 1 );
2692
2685
}
2693
-
2694
- } else if (wsdl == NULL ) {
2695
- php_error_docref (NULL TSRMLS_CC , E_WARNING , "'location' and 'uri' options are required in nonWSDL mode" );
2696
- return ;
2686
+ } else if (Z_TYPE_P (wsdl ) == IS_NULL ) {
2687
+ php_error_docref (NULL TSRMLS_CC , E_ERROR , "'location' and 'uri' options are required in nonWSDL mode" );
2697
2688
}
2698
2689
2699
2690
add_property_long (this_ptr , "_soap_version" , soap_version );
2700
2691
2701
- if (wsdl ) {
2692
+ if (Z_TYPE_P ( wsdl ) != IS_NULL ) {
2702
2693
int old_soap_version , ret ;
2703
2694
2704
2695
old_soap_version = SOAP_GLOBAL (soap_version );
0 commit comments