gitweb: Require project for all actions except few
PATCH 1/1 gitweb: Require project for all actions except few
Require that project (repository) is given for all actions except project_list, project_index and opml.
Signed-off-by Jakub Narebski <[email protected]>
--- gitweb/gitweb.perl | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)
gitweb/gitweb.perl +4 -0
@@ -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;
Signature · 1 line
1.4.2.1
Quoted 1 line · Jakub Narebski
+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_foofoo_project_list_barbar_project_index