From 8dd6dec64d4e55edef6c3b2a50814bd8376c36a1 Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Thu, 10 Jul 2008 18:24:10 +0200 Subject: [PATCH] cgi/tagproj.cgi: Treat spaces as tag separators --- cgi/tagproj.cgi | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/cgi/tagproj.cgi b/cgi/tagproj.cgi index 9d9794b..ef50677 100755 --- a/cgi/tagproj.cgi +++ b/cgi/tagproj.cgi @@ -12,7 +12,7 @@ use CGI; our $cgi = CGI->new; my $pname = $cgi->param('p'); -my $ctag = $cgi->param('t'); +my $ctags = $cgi->param('t'); my $proj = Git::RepoCGI::Project->load($pname); if (not $proj) { @@ -21,16 +21,18 @@ if (not $proj) { exit; } -if ($ctag =~ /[^ a-zA-Z0-9:.+_-]/) { +if ($ctags =~ /[^ a-zA-Z0-9:.+_-]/) { print $cgi->header(-status=>403); - print "Content tag '$ctag' contains evil characters."; + print "Content tag(s) '$ctags' contain evil characters."; exit; } -# Locking is not important -my $val = 0; -open CT, $proj->{path}."/ctags/$ctag" and $val = and close CT; -chomp $val; -open CT, '>'.$proj->{path}."/ctags/$ctag" and print CT ($val+1)."\n" and close CT; +foreach my $ctag (split(/ /, $ctags)) { + # Locking is not important + my $val = 0; + open CT, $proj->{path}."/ctags/$ctag" and $val = and close CT; + chomp $val; + open CT, '>'.$proj->{path}."/ctags/$ctag" and print CT ($val+1)."\n" and close CT; +} print $cgi->header(-status=>303, -location=>"/w/$pname.git"); -- 2.11.4.GIT