From 06053979b5c1b94bd4cad4361276abb8ec839f9f Mon Sep 17 00:00:00 2001 From: pk910 Date: Wed, 29 Aug 2012 03:34:56 +0200 Subject: [PATCH] fixed rev graphs --- git_graph.php | 2 +- patch/gitweb.cgi.diff | 15 +++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/git_graph.php b/git_graph.php index a749c24..1beae8c 100644 --- a/git_graph.php +++ b/git_graph.php @@ -59,7 +59,7 @@ if(!$project) die("ERROR 0x02"); //check other args -if(!preg_match('#^[a-z0-9]*$#i', $_GET['h'])) +if(!preg_match('#^[a-z0-9/.]*$#i', $_GET['h'])) die("ERROR 0x03"); if(!preg_match('#^[a-z0-9]*$#i', $_GET['c'])) die("ERROR 0x04"); diff --git a/patch/gitweb.cgi.diff b/patch/gitweb.cgi.diff index f2a9976..deff0c6 100644 --- a/patch/gitweb.cgi.diff +++ b/patch/gitweb.cgi.diff @@ -1,6 +1,6 @@ ---- index.cgi Tue Aug 28 23:20:03 2012 -+++ index-graph.cgi Tue Aug 28 23:21:08 2012 -@@ -4769,8 +4772,15 @@ +--- index.cgi Wed Aug 29 01:30:10 2012 ++++ index-graph.cgi Wed Aug 29 00:35:09 2012 +@@ -4769,8 +4772,18 @@ $from = 0 unless defined $from; $to = $#{$commitlist} if (!defined $to || $#{$commitlist} < $to); @@ -9,7 +9,10 @@ my $alternate = 1; + my $graph_rand = int(rand(99999)); + -+ my $head = git_get_head_hash($project); ++ my $head = git_get_head_hash($project); ++ if (!defined $hash) { ++ $hash = $head; ++ } + if (!defined $page) { + $page = 0; + } @@ -17,11 +20,11 @@ for (my $i = $from; $i <= $to; $i++) { my %co = %{$commitlist->[$i]}; my $commit = $co{'id'}; -@@ -4781,6 +4791,7 @@ +@@ -4781,6 +4794,7 @@ print "\n"; } $alternate ^= 1; -+ print ""; ++ print ""; # git_summary() used print "$co{'age_string'}\n" . print "$co{'age_string_date'}\n" . format_author_html('td', \%co, 10) . ""; -- 2.20.1