aboutsummaryrefslogtreecommitdiffstats
path: root/public/admin/model/localisation/currency.php
diff options
context:
space:
mode:
Diffstat (limited to 'public/admin/model/localisation/currency.php')
-rw-r--r--public/admin/model/localisation/currency.php14
1 files changed, 7 insertions, 7 deletions
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
+}