{"thread":{"id":"5606","subject":"[PATCH (amend)] gitweb: Require project for almost all actions","startedAt":"2006-09-19T19:53:22Z","lastAt":"2006-09-19T19:53:22Z","messageCount":1,"participants":["Jakub Narebski"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"27165","messageId":"200609192153.22618.jnareb@gmail.com","threadId":"5606","inReplyTo":null,"subject":"[PATCH (amend)] gitweb: Require project for almost all actions","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-09-19T19:53:22Z","receivedAt":"2006-09-19T19:53:22Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Require that project (repository) is given for all actions except\nproject_list, project_index and opml.\n\nSigned-off-by: Jakub Narebski <jnareb@gmail.com>\n---\n gitweb/gitweb.perl |    4 ++++\n 1 files changed, 4 insertions(+), 0 deletions(-)\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex 034cdf1..34311ee 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -341,6 +341,10 @@ if (defined $project) {\n if (!defined($actions{$action})) {\n \tdie_error(undef, \"Unknown action\");\n }\n+if ($action !~ m/^(opml|project_list|project_index)$/ &&\n+    !$project) {\n+\tdie_error(undef, \"Project needed\");\n+}\n $actions{$action}->();\n exit;\n \n-- \n1.4.2.1\n"}]}