. */ require 'config.php'; require 'common.php'; require 'Parsedown.php'; global $config; $url = Sanatise($_REQUEST['u']); $fname = basename($url); $cmd = $config['svn'] . ' cat --non-interactive ' . '--username=' . $config['username'] . ' ' . '--password=' . $config['password'] . ' ' . escapeshellarg($url); if (IsMarkdown($fname)) { header('Content-Type: text/html'); $output = shell_exec($cmd); $pd = new Parsedown(); echo $pd->text($output); } else { header('Content-Type: ' . GuessMimeType($fname)); header('Content-Disposition: inline; filename="' . $fname . '"'); passthru($cmd); } ?>