Skip to content

Commit

Permalink
Fix: $this->methodreturn can be array (#99)
Browse files Browse the repository at this point in the history
In function serialize_return, $this->methodreturn can be an array, resulting in "PHP Warning: get_class() expects parameter 1 to be object, array given"
Above code change fixes this by checking for object. However, without knowing the complete flow, I am unsure if there is an underlying issue which assigns incorrect type to $this->methodreturn.
  • Loading branch information
hbrecht authored Mar 6, 2023
1 parent 5ff01e1 commit 13b252c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/nusoap.php
Original file line number Diff line number Diff line change
Expand Up @@ -4224,7 +4224,7 @@ function serialize_return()
{
$this->debug('Entering serialize_return methodname: ' . $this->methodname . ' methodURI: ' . $this->methodURI);
// if fault
if (isset($this->methodreturn) && ((get_class($this->methodreturn) == 'soap_fault') || (get_class($this->methodreturn) == 'nusoap_fault'))) {
if (isset($this->methodreturn) && is_object($this->methodreturn) && ((get_class($this->methodreturn) == 'soap_fault') || (get_class($this->methodreturn) == 'nusoap_fault'))) {
$this->debug('got a fault object from method');
$this->fault = $this->methodreturn;
return;
Expand Down

0 comments on commit 13b252c

Please sign in to comment.