aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesús <heckyel@hyperbola.info>2020-11-25 21:57:52 -0500
committerJesús <heckyel@hyperbola.info>2020-11-25 21:57:52 -0500
commitc9818560f90e5720396c5b5acefcbd4d28cb91cc (patch)
tree84a314b1fcd098a94a8fd183f799fb329626f9bb
parent50a1a532e159e2e3cc89e3371ef3965c2b454784 (diff)
downloadlibrecart-c9818560f90e5720396c5b5acefcbd4d28cb91cc.tar.lz
librecart-c9818560f90e5720396c5b5acefcbd4d28cb91cc.tar.xz
librecart-c9818560f90e5720396c5b5acefcbd4d28cb91cc.zip
Fix notice and warning PHP 7.4.x
-rw-r--r--public/admin/controller/marketplace/marketplace.php14
-rw-r--r--public/admin/model/localisation/currency.php14
2 files changed, 14 insertions, 14 deletions
diff --git a/public/admin/controller/marketplace/marketplace.php b/public/admin/controller/marketplace/marketplace.php
index 914b1df..2e6ef8b 100644
--- a/public/admin/controller/marketplace/marketplace.php
+++ b/public/admin/controller/marketplace/marketplace.php
@@ -98,9 +98,9 @@ class ControllerMarketplaceMarketplace extends Controller {
'text' => $this->language->get('heading_title'),
'href' => $this->url->link('marketplace/marketplace', 'user_token=' . $this->session->data['user_token'] . $url, true)
);
-
+
$time = time();
-
+
// We create a hash from the data in a similar method to how amazon does things.
$string = 'marketplace/api/list' . "\n";
$string .= $this->config->get('opencart_username') . "\n";
@@ -164,7 +164,7 @@ class ControllerMarketplaceMarketplace extends Controller {
$response_info = json_decode($response, true);
- $extension_total = $response_info['extension_total'];
+ $extension_total = isset($response_info['extension_total']) ? $response_info['extension_total'] : null;
$url = '';
@@ -202,7 +202,7 @@ class ControllerMarketplaceMarketplace extends Controller {
$data['promotions'] = array();
- if ($response_info['promotions'] && $page == 1) {
+ if (isset($response_info['promotions']) && $page == 1) {
foreach ($response_info['promotions'] as $result) {
$data['promotions'][] = array(
'name' => $result['name'],
@@ -219,7 +219,7 @@ class ControllerMarketplaceMarketplace extends Controller {
$data['extensions'] = array();
- if ($response_info['extensions']) {
+ if (isset($response_info['extensions'])) {
foreach ($response_info['extensions'] as $result) {
$data['extensions'][] = array(
'name' => utf8_decode($result['name']),
@@ -921,8 +921,8 @@ class ControllerMarketplaceMarketplace extends Controller {
if (!$this->config->get('opencart_username') || !$this->config->get('opencart_secret')) {
$json['error'] = $this->language->get('error_opencart');
}
-
- if (!$json) {
+
+ if (!$json) {
$time = time();
// We create a hash from the data in a similar method to how amazon does things.
diff --git a/public/admin/model/localisation/currency.php b/public/admin/model/localisation/currency.php
index 3e478e5..7ea4769 100644
--- a/public/admin/model/localisation/currency.php
+++ b/public/admin/model/localisation/currency.php
@@ -10,7 +10,7 @@ class ModelLocalisationCurrency extends Model {
}
$this->cache->delete('currency');
-
+
return $currency_id;
}
@@ -128,7 +128,7 @@ class ModelLocalisationCurrency extends Model {
curl_setopt($curl, CURLOPT_TIMEOUT, 30);
$content = curl_exec($curl);
-
+
curl_close($curl);
$line = explode("\n", trim($content));
@@ -136,11 +136,11 @@ class ModelLocalisationCurrency extends Model {
for ($i = 0; $i < count($line); $i = $i + 2) {
$currency = utf8_substr($line[$i], 4, 3);
$value = utf8_substr($line[$i], 11, 6);
-
- if ((float)$value < 1 && isset($line[$i + 1])) {
+
+ if ((float)$value < 1 && isset($line[$i + 1]) && is_numeric(($line[$i + 1]))) {
$value = (1 / utf8_substr($line[$i + 1], 11, 6));
- }
-
+ }
+
if ((float)$value) {
$this->db->query("UPDATE " . DB_PREFIX . "currency SET value = '" . (float)$value . "', date_modified = '" . $this->db->escape(date('Y-m-d H:i:s')) . "' WHERE code = '" . $this->db->escape($currency) . "'");
}
@@ -156,4 +156,4 @@ class ModelLocalisationCurrency extends Model {
return $query->row['total'];
}
-} \ No newline at end of file
+}