git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] gitweb: Require project for all actions except few
@ 2006-09-19 12:38 Jakub Narebski
  2006-09-19 13:21 ` Matthias Lederhofer
  0 siblings, 1 reply; 2+ messages in thread
From: Jakub Narebski @ 2006-09-19 12:38 UTC (permalink / raw)
  To: git

Require that project (repository) is given for all actions except project_list,
project_index and opml.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
 gitweb/gitweb.perl |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 034cdf1..34311ee 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -341,6 +341,10 @@ if (defined $project) {
 if (!defined($actions{$action})) {
 	die_error(undef, "Unknown action");
 }
+if ($action !~ m/^opml|project_list|project_index$/ &&
+    !$project) {
+	die_error(undef, "Project needed");
+}
 $actions{$action}->();
 exit;
 
-- 
1.4.2.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] gitweb: Require project for all actions except few
  2006-09-19 12:38 [PATCH] gitweb: Require project for all actions except few Jakub Narebski
@ 2006-09-19 13:21 ` Matthias Lederhofer
  0 siblings, 0 replies; 2+ messages in thread
From: Matthias Lederhofer @ 2006-09-19 13:21 UTC (permalink / raw)
  To: Jakub Narebski; +Cc: git

Jakub Narebski <jnareb@gmail.com> wrote:
> +if ($action !~ m/^opml|project_list|project_index$/ &&
The regexp should be:
m/^(opml|project_list|project_index)$/ &&

% (echo opml_foo; echo foo_project_list_bar; echo bar_project_index) |
    perl -ne 'print if m/^opml|project_list|project_index$/;' 
opml_foo
foo_project_list_bar
bar_project_index

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-09-19 13:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-19 12:38 [PATCH] gitweb: Require project for all actions except few Jakub Narebski
2006-09-19 13:21 ` Matthias Lederhofer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).