@@ -1051,6 +1051,7 @@ PHP_METHOD(SoapServer, addFunction)
1051
1051
key = zend_string_tolower (Z_STR_P (tmp_function ));
1052
1052
1053
1053
if ((f = zend_hash_find_ptr (EG (function_table ), key )) == NULL ) {
1054
+ zend_string_release_ex (key , false);
1054
1055
zend_type_error ("SoapServer::addFunction(): Function \"%s\" not found" , Z_STRVAL_P (tmp_function ));
1055
1056
SOAP_SERVER_END_CODE ();
1056
1057
RETURN_THROWS ();
@@ -1069,6 +1070,7 @@ PHP_METHOD(SoapServer, addFunction)
1069
1070
key = zend_string_tolower (Z_STR_P (function_name ));
1070
1071
1071
1072
if ((f = zend_hash_find_ptr (EG (function_table ), key )) == NULL ) {
1073
+ zend_string_release_ex (key , false);
1072
1074
zend_argument_type_error (1 , "must be a valid function name, function \"%s\" not found" , Z_STRVAL_P (function_name ));
1073
1075
SOAP_SERVER_END_CODE ();
1074
1076
RETURN_THROWS ();
@@ -1395,8 +1397,7 @@ PHP_METHOD(SoapServer, handle)
1395
1397
}
1396
1398
}
1397
1399
#endif
1398
- zend_string * fn_name = zend_string_tolower (Z_STR (h -> function_name ));
1399
- if (zend_hash_exists (function_table , fn_name ) ||
1400
+ if (zend_hash_find_ptr_lc (function_table , Z_STR (h -> function_name )) != NULL ||
1400
1401
((service -> type == SOAP_CLASS || service -> type == SOAP_OBJECT ) &&
1401
1402
zend_hash_str_exists (function_table , ZEND_CALL_FUNC_NAME , sizeof (ZEND_CALL_FUNC_NAME )- 1 ))) {
1402
1403
if (service -> type == SOAP_CLASS || service -> type == SOAP_OBJECT ) {
@@ -1412,25 +1413,21 @@ PHP_METHOD(SoapServer, handle)
1412
1413
instanceof_function (Z_OBJCE (h -> retval ), soap_fault_class_entry )) {
1413
1414
php_output_discard ();
1414
1415
soap_server_fault_ex (function , & h -> retval , h );
1415
- zend_string_release (fn_name );
1416
1416
if (service -> type == SOAP_CLASS && soap_obj ) {zval_ptr_dtor (soap_obj );}
1417
1417
goto fail ;
1418
1418
} else if (EG (exception )) {
1419
1419
php_output_discard ();
1420
1420
_soap_server_exception (service , function , ZEND_THIS );
1421
- zend_string_release (fn_name );
1422
1421
if (service -> type == SOAP_CLASS && soap_obj ) {zval_ptr_dtor (soap_obj );}
1423
1422
goto fail ;
1424
1423
}
1425
1424
} else if (h -> mustUnderstand ) {
1426
1425
soap_server_fault ("MustUnderstand" ,"Header not understood" , NULL , NULL , NULL );
1427
1426
}
1428
- zend_string_release (fn_name );
1429
1427
}
1430
1428
}
1431
1429
1432
- zend_string * fn_name = zend_string_tolower (Z_STR (function_name ));
1433
- if (zend_hash_exists (function_table , fn_name ) ||
1430
+ if (zend_hash_find_ptr_lc (function_table , Z_STR (function_name )) != NULL ||
1434
1431
((service -> type == SOAP_CLASS || service -> type == SOAP_OBJECT ) &&
1435
1432
zend_hash_str_exists (function_table , ZEND_CALL_FUNC_NAME , sizeof (ZEND_CALL_FUNC_NAME )- 1 ))) {
1436
1433
if (service -> type == SOAP_CLASS || service -> type == SOAP_OBJECT ) {
@@ -1452,7 +1449,6 @@ PHP_METHOD(SoapServer, handle)
1452
1449
} else {
1453
1450
php_error (E_ERROR , "Function '%s' doesn't exist" , Z_STRVAL (function_name ));
1454
1451
}
1455
- zend_string_release (fn_name );
1456
1452
1457
1453
if (EG (exception )) {
1458
1454
if (!zend_is_unwind_exit (EG (exception ))) {
0 commit comments