diff options
Diffstat (limited to 'httpdocs/index.php')
-rw-r--r-- | httpdocs/index.php | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/httpdocs/index.php b/httpdocs/index.php index f912908..2bda913 100644 --- a/httpdocs/index.php +++ b/httpdocs/index.php @@ -65,8 +65,18 @@ if (isset($_GET['r'])) { )) == '0') die('Commit ' . $commit_identifier . ' is not signed by ' . $_GET['valid_keys']); } + if (isset($_GET['p'])) { + if (base64_decode($_GET['p'],true)===false) + die('Invalid base64'); + $prefix = ' --prefix="$(' . + 'echo "' . $_GET['p'] . '" | ' . + 'base64 -d' . + ')"'; + } else { + $prefix = ''; + } $handle = popen( - 'git -C "../work/repositories/' . $_GET['r'] . '" archive "' . $commit_identifier . '" | ' . + 'git -C "../work/repositories/' . $_GET['r'] . '" archive' . $prefix . ' "' . $commit_identifier . '" | ' . 'gzip -nc', 'r' ); |