From 234162978f312fe242481cf44feea106e6a84ba7 Mon Sep 17 00:00:00 2001 From: Janusz Dobrowolski Date: Mon, 20 May 2013 14:41:52 +0200 Subject: [PATCH] Fixing cookie.txt location during access to remote exchange rate server. --- gl/includes/db/gl_db_rates.inc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gl/includes/db/gl_db_rates.inc b/gl/includes/db/gl_db_rates.inc index 9f0f101..f3237d5 100644 --- a/gl/includes/db/gl_db_rates.inc +++ b/gl/includes/db/gl_db_rates.inc @@ -88,6 +88,8 @@ function retrieve_exrate($curr_b, $date) function get_extern_rate($curr_b, $provider = 'ECB', $date) { + global $path_to_root; + $curr_a = get_company_pref('curr_default'); if ($provider == 'ECB') { @@ -118,7 +120,7 @@ function get_extern_rate($curr_b, $provider = 'ECB', $date) do { $ch = curl_init(); curl_setopt ($ch, CURLOPT_URL, 'http://'.$site.$filename); - curl_setopt ($ch, CURLOPT_COOKIEJAR, "cookie.txt"); + curl_setopt ($ch, CURLOPT_COOKIEJAR, "$path_to_root/tmp/cookie.txt"); curl_setopt ($ch, CURLOPT_HEADER, 0); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); // prevent warning while save_mode/open_basedir on (redireciton doesn't occur at least on ECB page) -- 2.30.2