Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F1051537
D329.id820.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, Jul 4, 1:08 AM
Size
2 KB
Mime Type
text/x-diff
Expires
Sat, Jul 5, 1:08 AM (9 h, 58 m)
Engine
blob
Format
Raw Data
Handle
679312
Attached To
D329: MINC-194 Fix ECB currency rate downloader
D329.id820.diff
View Options
Index: modules/in-commerce/units/helpers/bank_lv_currency_rates.php
===================================================================
--- modules/in-commerce/units/helpers/bank_lv_currency_rates.php
+++ modules/in-commerce/units/helpers/bank_lv_currency_rates.php
@@ -28,9 +28,14 @@
/** @var kCurlHelper $curl_helper */
$curl_helper = $this->Application->recallObject('CurlHelper');
+ $curl_helper->followLocation = true;
$xml = $curl_helper->Send($this->RateSource);
+ if ( !$curl_helper->isGoodResponseCode() || strlen($xml) == 0 ) {
+ return;
+ }
+
xml_parse_into_struct($xml_parser, $xml, $struct, $index);
$data_res = Array();
$currency = '';
Index: modules/in-commerce/units/helpers/ecb_currency_rates.php
===================================================================
--- modules/in-commerce/units/helpers/ecb_currency_rates.php
+++ modules/in-commerce/units/helpers/ecb_currency_rates.php
@@ -17,7 +17,7 @@
public function __construct()
{
- $this->RateSource = 'http://www.ecb.int/stats/eurofxref/eurofxref-daily.xml';
+ $this->RateSource = 'http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml';
parent::__construct();
}
@@ -28,9 +28,14 @@
/** @var kCurlHelper $curl_helper */
$curl_helper = $this->Application->recallObject('CurlHelper');
+ $curl_helper->followLocation = true;
$xml = $curl_helper->Send($this->RateSource);
+ if ( !$curl_helper->isGoodResponseCode() || strlen($xml) == 0 ) {
+ return;
+ }
+
xml_parse_into_struct($xml_parser, $xml, $struct, $index);
$data_res = Array();
foreach($struct as $element)
Index: modules/in-commerce/units/helpers/frny_currency_rates.php
===================================================================
--- modules/in-commerce/units/helpers/frny_currency_rates.php
+++ modules/in-commerce/units/helpers/frny_currency_rates.php
@@ -26,6 +26,7 @@
{
/** @var kCurlHelper $curl_helper */
$curl_helper = $this->Application->recallObject('CurlHelper');
+ $curl_helper->followLocation = true;
for($i = 0; $i < 10; $i++)
{
@@ -33,6 +34,10 @@
$source_file = sprintf($this->RateSource, adodb_date('Y-m-d', $time));
$xml = $curl_helper->Send($source_file);
+ if ( !$curl_helper->isGoodResponseCode() || strlen($xml) == 0 ) {
+ continue;
+ }
+
$xml_parser = xml_parser_create();
xml_parse_into_struct($xml_parser, $xml, $struct, $index);
foreach($struct as $element)
Event Timeline
Log In to Comment