diff options
Diffstat (limited to 'httpdocs')
-rw-r--r-- | httpdocs/index.php | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/httpdocs/index.php b/httpdocs/index.php index 4f11f49..3295c38 100644 --- a/httpdocs/index.php +++ b/httpdocs/index.php @@ -18,11 +18,18 @@ if (isset($_GET['r'])) { if (base64_decode($_GET['tag'],true)===false) $_GET['tag'] = base64_encode($_GET['tag']); - $handle = popen( - 'git -C "../work/repositories/' . $_GET['r'] . '" archive "$(' . + $commit_identifier = '$(' . 'echo "' . $_GET['tag'] . '" | ' . 'base64 -d' . - ')" | ' . + ')'; + } elseif (isset($_GET['commit'])) { + if (preg_match('/^[a-f0-9]{40}$/', $_GET['commit'])) + $commit_identifier = $_GET['commit']; + } + + if (isset($commit_identifier)) { + $handle = popen( + 'git -C "../work/repositories/' . $_GET['r'] . '" archive "' . $commit_identifier . '" | ' . 'gzip -nc', 'r' ); |