Skip to content

Commit

Permalink
fix nusoapp base
Browse files Browse the repository at this point in the history
  • Loading branch information
hungnguyenhp committed Sep 25, 2021
1 parent 04fad11 commit 019f13f
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions fixed/nusoap_base.php
Original file line number Diff line number Diff line change
Expand Up @@ -386,20 +386,24 @@ function expandEntities($val)
* @return mixed error string or false
* @access public
*/

function getError()
{
if ($this->error_str != '') {
if ($this->error_str !== '') {
return $this->error_str;
}

return false;
}

/**
* sets error string
* Function setError sets error string
*
* @return boolean $string error string
* @access private
* @param $str
*
* @author : 713uk13m <[email protected]>
* @copyright: 713uk13m <[email protected]>
* @time : 09/25/2021 11:55
*/
function setError($str)
{
Expand Down Expand Up @@ -448,7 +452,7 @@ function serialize_val($val, $name = false, $type = false, $name_ns = false, $ty
$this->appendDebug('value=' . $this->varDump($val));
$this->appendDebug('attributes=' . $this->varDump($attributes));

if (is_object($val) && get_class($val) == 'soapval' && (!$soapval)) {
if (is_object($val) && $val instanceof \soapval && (!$soapval)) {
$this->debug("serialize_val: serialize soapval");
$xml = $val->serialize($use);
$this->appendDebug($val->getDebug());
Expand All @@ -466,7 +470,7 @@ function serialize_val($val, $name = false, $type = false, $name_ns = false, $ty
// if name has ns, add ns prefix to name
$xmlns = '';
if ($name_ns) {
$prefix = 'nu' . rand(1000, 9999);
$prefix = 'nu' . mt_rand(1000, 9999);
$name = $prefix . ':' . $name;
$xmlns .= " xmlns:$prefix=\"$name_ns\"";
}
Expand All @@ -476,7 +480,7 @@ function serialize_val($val, $name = false, $type = false, $name_ns = false, $ty
// w/o checking against typemap
$type_prefix = 'xsd';
} elseif ($type_ns) {
$type_prefix = 'ns' . rand(1000, 9999);
$type_prefix = 'ns' . mt_rand(1000, 9999);
$xmlns .= " xmlns:$type_prefix=\"$type_ns\"";
}
// serialize attributes if present
Expand Down

0 comments on commit 019f13f

Please sign in to comment.