Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions Controller/Logger/ClerkLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,9 @@ public function log($Message, $Metadata)

}

curl_close($curl);
if (PHP_VERSION_ID < 80000) {
curl_close($curl);
}

} elseif ($this->Log_to == 'file') {

Expand Down Expand Up @@ -442,7 +444,9 @@ public function error($Message, $Metadata)

}

curl_close($curl);
if (PHP_VERSION_ID < 80000) {
curl_close($curl);
}

} elseif ($this->Log_to == 'file') {

Expand Down Expand Up @@ -521,7 +525,9 @@ public function warn($Message, $Metadata)

}

curl_close($curl);
if (PHP_VERSION_ID < 80000) {
curl_close($curl);
}

} elseif ($this->Log_to == 'file') {

Expand Down
4 changes: 2 additions & 2 deletions Model/Adapter/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,7 @@ protected function addFieldHandlers()
foreach ($productsArray as $bundle_item) {
$bundle_option_min_stock = 0;
foreach ($bundle_item as $bundle_option) {
if ((integer)$bundle_option['min_qty'] <= $bundle_option['stock']) {
if ((int)$bundle_option['min_qty'] <= $bundle_option['stock']) {
$bundle_option_min_stock = ($bundle_option_min_stock == 0) ? $bundle_option['stock'] : $bundle_option_min_stock;
$bundle_option_min_stock = ($bundle_option_min_stock < $bundle_option['stock']) ? $bundle_option['stock'] : $bundle_option_min_stock;
}
Expand Down Expand Up @@ -768,7 +768,7 @@ protected function addFieldHandlers()
foreach ($productsArray as $bundle_item) {
$bundle_option_min_stock = 0;
foreach ($bundle_item as $bundle_option) {
if ((integer)$bundle_option['min_qty'] <= $bundle_option['stock']) {
if ((int)$bundle_option['min_qty'] <= $bundle_option['stock']) {
$bundle_option_min_stock = ($bundle_option_min_stock == 0) ? $bundle_option['stock'] : $bundle_option_min_stock;
$bundle_option_min_stock = ($bundle_option_min_stock < $bundle_option['stock']) ? $bundle_option['stock'] : $bundle_option_min_stock;
}
Expand Down
12 changes: 10 additions & 2 deletions Model/Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,11 @@ private function _curl_get($url, $params = [])
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($curl);
curl_close($curl);

if (PHP_VERSION_ID < 80000) {
curl_close($curl);
}

return $response;

} catch (\Exception $e) {
Expand All @@ -201,7 +205,11 @@ private function _curl_post($url, $params = [])
}
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($curl);
curl_close($curl);

if (PHP_VERSION_ID < 80000) {
curl_close($curl);
}

return $response;

} catch (\Exception $e) {
Expand Down