raw download for older revisions
[phorkie.git] / src / phorkie / File.php
index bc0950fce26f1c1d583649f2e6440b5b1b5db904..acc44cd884468e45ee8248dc8740e3a8661476c8 100644 (file)
@@ -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();
         }