aboutsummaryrefslogtreecommitdiff
path: root/src/phorkie/File.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/phorkie/File.php')
-rw-r--r--src/phorkie/File.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/phorkie/File.php b/src/phorkie/File.php
index bc0950f..acc44cd 100644
--- a/src/phorkie/File.php
+++ b/src/phorkie/File.php
@@ -102,7 +102,12 @@ class File
public function getLink($type, $option = null)
{
if ($type == 'raw') {
- return '/' . $this->repo->id . '/raw/' . $this->getFilename();
+ if ($this->repo->hash === null) {
+ return '/' . $this->repo->id . '/raw/' . $this->getFilename();
+ } else {
+ return '/' . $this->repo->id . '/rev-raw/' . $this->repo->hash
+ . '/' . $this->getFilename();
+ }
} else if ($type == 'tool') {
return '/' . $this->repo->id . '/tool/' . $option . '/' . $this->getFilename();
}