From 7d34d0b9621d3ec4ec9b38f9633e6301d6592dc4 Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Wed, 13 Mar 2024 18:26:18 +0100 Subject: [PATCH] defined() to check if const is defined --- Trustly/Api/api.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Trustly/Api/api.php b/Trustly/Api/api.php index c9fee7d..09e0160 100644 --- a/Trustly/Api/api.php +++ b/Trustly/Api/api.php @@ -295,13 +295,13 @@ public function post($url=NULL, $postdata=NULL) { curl_setopt($curl, CURLOPT_PORT, $this->api_port); if($this->api_is_https) { - if(@CURLOPT_PROTOCOLS != 'CURLOPT_PROTOCOLS') { + if(defined('CURLOPT_PROTOCOLS')) { curl_setopt($curl, CURLOPT_PROTOCOLS, CURLPROTO_HTTPS); } curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 2); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, TRUE); } else { - if(@CURLOPT_PROTOCOLS != 'CURLOPT_PROTOCOLS') { + if(defined('CURLOPT_PROTOCOLS')) { curl_setopt($curl, CURLOPT_PROTOCOLS, CURLPROTO_HTTP); } }