From 6bc54d97762466b37c3d327c52cce589102355d5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Carretero?=
 <frederic.carretero@veremes.com>
Date: Thu, 6 Dec 2018 11:39:29 +0100
Subject: [PATCH] Correction dans la classe "File_downloader"

---
 src/vitis/vas/rest/ws/vitis/File_downloader.class.inc | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/vitis/vas/rest/ws/vitis/File_downloader.class.inc b/src/vitis/vas/rest/ws/vitis/File_downloader.class.inc
index 2fab279f..16451128 100644
--- a/src/vitis/vas/rest/ws/vitis/File_downloader.class.inc
+++ b/src/vitis/vas/rest/ws/vitis/File_downloader.class.inc
@@ -128,7 +128,10 @@ class File_downloader extends Vitis {
 
           } else {
             // modification de $sPath pour aller chercher le fichier dans ws_data
-            $sPath = $this->aProperties["ws_data_dir"] . "/" . $this->aValues["key"];
+            if (strpos($this->aValues["key"], 'ws_data') === 0)
+              $sPath = str_replace('ws_data', $this->aProperties['ws_data_dir'], $this->aValues["key"]);
+            else
+              $sPath = $this->aProperties["ws_data_dir"] . "/" . $this->aValues["key"];
             // check eTag
             $sEtag = sha1(file_get_contents($sPath), false);
 
-- 
GitLab