aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorqorg11 <qorg@vxempire.xyz>2020-10-17 03:30:24 +0200
committerqorg11 <qorg@vxempire.xyz>2020-10-17 03:30:24 +0200
commit3aa2c29a9ad084639a1ea348809210dd781cb41d (patch)
tree8644c781aa7fe1bae8d41672a9a7abf4e870e68c
parentbea5476e9c86317431fc4386af24c385b4e2eac7 (diff)
downloadgitweb-3aa2c29a9ad084639a1ea348809210dd781cb41d.tar.gz
gitweb-3aa2c29a9ad084639a1ea348809210dd781cb41d.tar.bz2
gitweb-3aa2c29a9ad084639a1ea348809210dd781cb41d.zip
Now you can put README.MD in the document root and will be displayed!
-rwxr-xr-xgitweb.cgi13
1 files changed, 7 insertions, 6 deletions
diff --git a/gitweb.cgi b/gitweb.cgi
index c73cc17..429cf64 100755
--- a/gitweb.cgi
+++ b/gitweb.cgi
@@ -6592,12 +6592,6 @@ sub git_summary {
# If XSS prevention is on, we don't include README.html.
# TODO: Allow a readme in some safe format.
- if (!$prevent_xss && -s "$projectroot/$project/README.html") {
- print "<div class=\"title\">readme</div>\n" .
- "<div class=\"readme\">\n";
- insert_file("$projectroot/$project/README.md");
- print "\n</div>\n"; # class="readme"
- }
# we need to request one more than 16 (0..15) to check if
# those 16 are all
@@ -6635,6 +6629,13 @@ sub git_summary {
$cgi->a({-href => href(action=>"forks")}, "..."),
'no_header');
}
+ if (!$prevent_xss) {
+ print "<div class=\"title\">readme</div>\n" .
+ "<div class=\"readme\">\n";
+ system("cd /home/git/$project && git show HEAD:README.md|pandoc --to html"); # Which is a safer
+ # way to do this?
+ print "\n</div>\n"; # class="readme"
+ }
git_footer_html();
}