Changeset 746 for trunk/lib/Currency.inc.php
- Timestamp:
- May 31, 2021 1:51:18 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/Currency.inc.php
r550 r746 123 123 public function getValue($amount, $base, $target) 124 124 { 125 if (false !== $rate = $this->getRate($base, $target)) {125 if (false !== ($rate = $this->getRate($base, $target))) { 126 126 return abs($rate * $amount); 127 127 } else { … … 231 231 // Fetch XML from ECB <http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml> 232 232 $api_url = 'http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml'; 233 if (false === $sXML = file_get_contents($api_url)) {233 if (false === ($sXML = file_get_contents($api_url))) { 234 234 $app->logMsg(sprintf('Failed to load ECB XML data from: %s', $api_url), LOG_WARNING, __FILE__, __LINE__); 235 235 return false; 236 236 } 237 if (false === $oXML = simplexml_load_string($sXML)) {237 if (false === ($oXML = simplexml_load_string($sXML))) { 238 238 $app->logMsg(sprintf('Failed to decode ECB XML data: %s', truncate($sXML, 200, 'end')), LOG_WARNING, __FILE__, __LINE__); 239 239 return false;
Note: See TracChangeset
for help on using the changeset viewer.