瀏覽代碼

#5491 PHP 8.5 compatibility

Aleksandr Trofimov 5 月之前
父節點
當前提交
d3334d9d5f

+ 0 - 1
inc/classes/BxDolPushOneSignal.php

@@ -103,7 +103,6 @@ class BxDolPushOneSignal extends BxDolPush
             curl_setopt($oChannel, CURLOPT_SSL_VERIFYPEER, false);
 
         $sResult = curl_exec($oChannel);
-        curl_close($oChannel);
 
         $oResult = @json_decode($sResult, true);
         if(isset($oResult['errors']))

+ 0 - 1
inc/classes/BxDolPushWonderPush.php

@@ -127,7 +127,6 @@ class BxDolPushWonderPush extends BxDolPush
             curl_setopt($oChannel, CURLOPT_SSL_VERIFYPEER, false);
 
         $sResult = curl_exec($oChannel);
-        curl_close($oChannel);
 
         $oResult = @json_decode($sResult, true);
         

+ 1 - 1
inc/classes/BxDolSmsSmsRu.php

@@ -299,7 +299,7 @@ class SMSRU {
 		} else {
 			$error = FALSE;
 		}
-		curl_close($ch);
+
 		if ($error && $this->count_repeat > 0) {
 			$this->count_repeat--;
 			return $this->Request($url, $r_post);

+ 0 - 6
inc/classes/BxDolXmlParser.php

@@ -47,7 +47,6 @@ class BxDolXmlParser extends BxDolFactory implements iBxDolSingleton
         $aValues = $aIndexes = array();
         $rParser = xml_parser_create("UTF-8");
         xml_parse_into_struct($rParser, $sXmlContent, $aValues, $aIndexes);
-        xml_parser_free($rParser);
 
         $sTag = strtoupper($sXmlTag);
         if(!isset($aIndexes[$sTag]))
@@ -69,7 +68,6 @@ class BxDolXmlParser extends BxDolFactory implements iBxDolSingleton
         $aValues = $aIndexes = array();
         $rParser = xml_parser_create("UTF-8");
         xml_parse_into_struct($rParser, $sXmlContent, $aValues, $aIndexes);
-        xml_parser_free($rParser);
 
         /**
          * gets two-dimensional array of attributes.
@@ -98,7 +96,6 @@ class BxDolXmlParser extends BxDolFactory implements iBxDolSingleton
         $aValues = $aIndexes = array();
         $rParser = xml_parser_create("UTF-8");
         xml_parse_into_struct($rParser, $sXmlContent, $aValues, $aIndexes);
-        xml_parser_free($rParser);
 
         //--- Get an array of tags ---//
         if($iXmlTagIndex == -1) {
@@ -138,7 +135,6 @@ class BxDolXmlParser extends BxDolFactory implements iBxDolSingleton
         $aValues = $aIndexes = array();
         $rParser = xml_parser_create("UTF-8");
         xml_parse_into_struct($rParser, $sXmlContent, $aValues, $aIndexes);
-        xml_parser_free($rParser);
 
         $sTag = strtoupper($sXmlTagName);
         $aTagIndexes = isset($aIndexes[$sTag]) ? $aIndexes[$sTag] : array();
@@ -161,7 +157,6 @@ class BxDolXmlParser extends BxDolFactory implements iBxDolSingleton
         $aValues = $aIndexes = array();
         $rParser = xml_parser_create("UTF-8");
         xml_parse_into_struct($rParser, $sXmlContent, $aValues, $aIndexes);
-        xml_parser_free($rParser);
 
         $aTagIndexes = $aIndexes[strtoupper($sXmlTagName)];
         if(count($aTagIndexes) == 0) return $this->getContent();
@@ -182,7 +177,6 @@ class BxDolXmlParser extends BxDolFactory implements iBxDolSingleton
         $aValues = $aIndexes = array();
         $rParser = xml_parser_create("UTF-8");
         xml_parse_into_struct($rParser, $sXmlContent, $aValues, $aIndexes);
-        xml_parser_free($rParser);
 
         $aTagIndexes = $aIndexes[strtoupper($sXmlTagName)];
         $iLastTagIndex = $aTagIndexes[count($aTagIndexes) - 1];

+ 0 - 1
inc/utils.inc.php

@@ -1154,7 +1154,6 @@ function bx_file_get_contents($sFileUrl, $aParams = array(), $sMethod = 'get', $
         if (NULL !== $sHttpCode)
             $sHttpCode = curl_getinfo($rConnect, CURLINFO_HTTP_CODE);
 
-        curl_close($rConnect);
     }
     else {
 

+ 0 - 2
modules/boonex/drupal_connect/classes/BxDrupalFormLogin.php

@@ -85,8 +85,6 @@ class BxDrupalFormLogin extends BxTemplFormLogin
             }
         }
 
-        curl_close($rCurl);
-
         return $mixedResult;
     }
 }

+ 0 - 2
modules/boonex/elasticsearch/classes/BxElsApi.php

@@ -229,8 +229,6 @@ class BxElsApi extends BxDol
         if (NULL !== $sHttpCode)
             $sHttpCode = curl_getinfo($rConnect, CURLINFO_HTTP_CODE);
 
-        curl_close($rConnect);
-
         return $sResult;
     }
 

+ 1 - 1
modules/boonex/facebook_connect/plugins/graph-sdk/src/Facebook/HttpClients/FacebookCurl.php

@@ -124,6 +124,6 @@ class FacebookCurl
      */
     public function close()
     {
-        curl_close($this->curl);
+        // curl_close($this->curl); // it does nothing since PHP 8.0
     }
 }

+ 0 - 2
modules/boonex/intercom/classes/BxIntercomModule.php

@@ -344,11 +344,9 @@ EOS;
 
         if (false === $sResult) {
             $sError = curl_error ($r);
-            curl_close($r);
             return false;
         }
 
-        curl_close($r);
         return $sResult;
     }
 }

+ 0 - 2
modules/boonex/mailchimp/classes/BxMailchimpModule.php

@@ -328,11 +328,9 @@ class BxMailchimpModule extends BxDolModule
 
         if (false === $sResult) {
             $sError = curl_error ($r);
-            curl_close($r);
             return false;
         }
 
-        curl_close($r);
         return $sResult;
     }
 }

+ 0 - 3
modules/boonex/payment/classes/BxPaymentProviderPayPal.php

@@ -269,13 +269,10 @@ class BxPaymentProviderPayPal extends BxBaseModPaymentProvider implements iBxBas
 		if(!$sResponse) {
 		    $this->log('Validation Data: ' . curl_error($rConnect), '', BX_LOG_ERR);
             $this->log($sResponse, '', BX_LOG_ERR);
-			curl_close($rConnect);
 
 			return array('code' => 5, 'message' => $this->_sLangsPrefix . 'err_cannot_validate');
 		}
 
-		curl_close($rConnect);
-
 		$aResponse = explode("\n", $sResponse);
 
 		$this->log('Validation Response: ', '', BX_LOG_INFO);

+ 0 - 1
scripts/update_checker.php

@@ -246,7 +246,6 @@ class SQLUpdateChecker {
         $response = curl_exec($ch);
         $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
         $error = curl_error($ch);
-        curl_close($ch);
         
         if ($error) {
             $this->error("CURL error: $error");

+ 0 - 2
scripts/update_gen.php

@@ -253,7 +253,6 @@ class SQLUpdateChecker {
         $response = curl_exec($ch);
         $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
         $error = curl_error($ch);
-        curl_close($ch);
         
         if ($error) {
             $this->error("CURL error: $error");
@@ -300,7 +299,6 @@ class SQLUpdateChecker {
         $response = curl_exec($ch);
         $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
         $error = curl_error($ch);
-        curl_close($ch);
         
         if ($error) {
             $this->error("CURL error: $error");