Changeset 3130959
- Timestamp:
- 08/05/2024 10:39:06 AM (18 months ago)
- Location:
- cloudpayments-gateway-for-woocommerce
- Files:
-
- 2 edited
-
tags/3.2.1/inc/class-cloud-payments-api.php (modified) (3 diffs)
-
trunk/inc/class-cloud-payments-api.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
cloudpayments-gateway-for-woocommerce/tags/3.2.1/inc/class-cloud-payments-api.php
r3130931 r3130959 28 28 exit('{"error":"empty request"}'); 29 29 30 if (!$this->CheckH Mac()){30 if (!$this->CheckHmac()){ 31 31 exit('{"error":"access denied"}'); 32 32 } … … 242 242 } 243 243 244 private function CheckH Mac()244 private function CheckHmac() 245 245 { 246 246 $headers = $this->detallheaders(); 247 if (!array_key_exists('Content-H MAC', $headers) && !array_key_exists('Content-Hmac', $headers)) {247 if (!array_key_exists('Content-Hmac', $headers)) { 248 248 return false; 249 249 } … … 251 251 $s = hash_hmac('sha256', $message, $this->api_pass, true); 252 252 $hmac = base64_encode($s); 253 return $headers['Content-H MAC'] == $hmac || $headers['Content-Hmac'] == $hmac;253 return $headers['Content-Hmac'] == $hmac; 254 254 } 255 255 -
cloudpayments-gateway-for-woocommerce/trunk/inc/class-cloud-payments-api.php
r3130931 r3130959 28 28 exit('{"error":"empty request"}'); 29 29 30 if (!$this->CheckH Mac()){30 if (!$this->CheckHmac()){ 31 31 exit('{"error":"access denied"}'); 32 32 } … … 242 242 } 243 243 244 private function CheckH Mac()244 private function CheckHmac() 245 245 { 246 246 $headers = $this->detallheaders(); 247 if (!array_key_exists('Content-H MAC', $headers) && !array_key_exists('Content-Hmac', $headers)) {247 if (!array_key_exists('Content-Hmac', $headers)) { 248 248 return false; 249 249 } … … 251 251 $s = hash_hmac('sha256', $message, $this->api_pass, true); 252 252 $hmac = base64_encode($s); 253 return $headers['Content-H MAC'] == $hmac || $headers['Content-Hmac'] == $hmac;253 return $headers['Content-Hmac'] == $hmac; 254 254 } 255 255
Note: See TracChangeset
for help on using the changeset viewer.