DataObjects/core.sql
[Pman.Core] / I18n.php
index 2ac6616..009c26d 100644 (file)
--- a/I18n.php
+++ b/I18n.php
@@ -287,11 +287,15 @@ class Pman_Core_I18n extends Pman
         }
         $target = ini_get('session.save_path').'/eurofxref-daily.xml';
         if (!file_exists($target) || filemtime($target) < (time() - 60*60*24)) {
+            // this may fail...
             $f = @file_get_contents('http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml');
             if (!strlen($f)) {
-                return false;
+                $target = dirname(__FILE__).'/eurofxref-daily.xml';
+                
+                
+            } else {
+                file_put_contents($target,$f);
             }
-            file_put_contents($target,$f);
         } 
         $dom = simplexml_load_file($target);
         $this->rates['EUR'] = 1.0;