Skip to contentSkip to conversation

gitweb: Require project for almost all actions

PATCH New Jakub Narebski 1 participant 1 message Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gitweb: Require project for almost all actions

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

---
 gitweb/gitweb.perl |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
gitweb/gitweb.perl +4 -0
index 034cdf1..34311ee 100755
@@ -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