diff --git a/php/src/Kernel/Util/Signer.php b/php/src/Kernel/Util/Signer.php index fb5e314..96a8154 100644 --- a/php/src/Kernel/Util/Signer.php +++ b/php/src/Kernel/Util/Signer.php @@ -51,6 +51,7 @@ public function verifyParams($parameters, $publicKey) public function getSignContent($params) { + $params=$this->removeEscapesFromArray($params); ksort($params); unset($params['sign']); unset($params['sign_type']); @@ -69,4 +70,18 @@ public function getSignContent($params) unset ($k, $v); return $stringToBeSigned; } -} \ No newline at end of file + + public function removeEscapesFromArray($array) { + $result = array(); + foreach ($array as $key => $value) { + if (is_string($value)) { + $result[$key] = stripslashes($value); + } elseif (is_array($value)) { + $result[$key] = $this->removeEscapesFromArray($value); + } else { + $result[$key] = $value; + } + } + return $result; + } +}