showing links only to existent output files

Project: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/commit/3a3059ac
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/3a3059ac
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/3a3059ac

Branch: refs/heads/dreg-gateway
Commit: 3a3059ac66cfc3145eda29620605594207a0b25b
Parents: 27a4717
Author: scnakandala <supun.nakand...@gmail.com>
Authored: Thu Jul 27 11:54:29 2017 -0400
Committer: scnakandala <supun.nakand...@gmail.com>
Committed: Thu Jul 27 11:54:29 2017 -0400

----------------------------------------------------------------------
 app/libraries/ExperimentUtilities.php | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/3a3059ac/app/libraries/ExperimentUtilities.php
----------------------------------------------------------------------
diff --git a/app/libraries/ExperimentUtilities.php 
b/app/libraries/ExperimentUtilities.php
index 6abb6d6..9424893 100755
--- a/app/libraries/ExperimentUtilities.php
+++ b/app/libraries/ExperimentUtilities.php
@@ -179,8 +179,10 @@ class ExperimentUtilities
                 $dataRoot = 
Config::get("pga_config.airavata")["experiment-data-absolute-path"];
                 if(!ExperimentUtilities::endsWith($dataRoot, "/"))
                     $dataRoot = $dataRoot . "/";
-                $filePath = str_replace($dataRoot, "", 
parse_url($output->value, PHP_URL_PATH));
+
+                $filePath = parse_url($output->value, PHP_URL_PATH);
                 if(file_exists($filePath)){
+                    $filePath = str_replace($dataRoot, "", 
parse_url($output->value, PHP_URL_PATH));
                     echo '<p>' . $output->name . ':&nbsp;<a target="_blank" 
href="' . URL::to("/")
                         . '/download/?path=' . $filePath . '">' . 
basename($filePath) . ' <span class="glyphicon 
glyphicon-new-window"></span></a></p>';
                 }

Reply via email to