Skip to content

Commit

Permalink
Use zend_call_method in SoapFault::__toString()
Browse files Browse the repository at this point in the history
  • Loading branch information
nikic committed Jul 23, 2020
1 parent a1ab7bb commit 8688206
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions ext/soap/soap.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#endif
#include "soap_arginfo.h"
#include "zend_exceptions.h"
#include "zend_interfaces.h"


static int le_sdl = 0;
Expand Down Expand Up @@ -633,7 +634,6 @@ PHP_METHOD(SoapFault, __toString)
{
zval *faultcode, *faultstring, *file, *line, trace, rv1, rv2, rv3, rv4;
zend_string *str;
zend_fcall_info fci;
zval *this_ptr;
zend_string *faultcode_val, *faultstring_val, *file_val;
zend_long line_val;
Expand All @@ -648,16 +648,8 @@ PHP_METHOD(SoapFault, __toString)
file = zend_read_property(soap_fault_class_entry, this_ptr, "file", sizeof("file")-1, 1, &rv3);
line = zend_read_property(soap_fault_class_entry, this_ptr, "line", sizeof("line")-1, 1, &rv4);

fci.size = sizeof(fci);
ZVAL_STRINGL(&fci.function_name, "gettraceasstring", sizeof("gettraceasstring")-1);
fci.object = Z_OBJ_P(ZEND_THIS);
fci.retval = &trace;
fci.param_count = 0;
fci.params = NULL;

zend_call_function(&fci, NULL);

zval_ptr_dtor(&fci.function_name);
zend_call_method_with_0_params(
Z_OBJ_P(ZEND_THIS), Z_OBJCE_P(ZEND_THIS), NULL, "gettraceasstring", &trace);

faultcode_val = zval_get_string(faultcode);
faultstring_val = zval_get_string(faultstring);
Expand Down

0 comments on commit 8688206

Please sign in to comment.