{"thread":{"id":"4605","subject":"[PATCH] gitweb: Make use of $PATH_INFO for project parameter","startedAt":"2006-06-21T14:47:54Z","lastAt":"2006-06-21T15:06:39Z","messageCount":3,"participants":["Jakub Narebski"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"22212","messageId":"11509012742493-git-send-email-jnareb@gmail.com","threadId":"4605","inReplyTo":null,"subject":"[PATCH] gitweb: Make use of $PATH_INFO for project parameter","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-06-21T14:47:54Z","receivedAt":"2006-06-21T14:47:54Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Allow to have project name in the path part of URL, just after the name of\nscript. For example instead of gitweb.cgi?p=git.git you can write\ngitweb.cgi/git.git or gitweb.cgi/git.git/\n\nNot used in URLs inside gitweb; it means that the above alternate syntax\nmust be generated by hand, at least for now.\n\nSide effect: project name parameter is now stripped of leading and\ntrailing slash before validation.\n\nSigned-off-by: Jakub Narebski <jnareb@gmail.com>\n\n---\n\n gitweb/gitweb.cgi |    3 ++-\n 1 files changed, 2 insertions(+), 1 deletions(-)\n\n51faac72f83777ced3d9d3544cc6d47431d1b8ee\ndiff --git a/gitweb/gitweb.cgi b/gitweb/gitweb.cgi\nindex e044c61..91698df 100755\n--- a/gitweb/gitweb.cgi\n+++ b/gitweb/gitweb.cgi\n@@ -86,7 +86,8 @@ if (defined $order) {\n \t}\n }\n \n-my $project = $cgi->param('p');\n+my $project = ($cgi->param('p') || $ENV{'PATH_INFO'});\n+$project =~ s|^/||; $project =~ s|/$||;\n if (defined $project) {\n \t$project = validate_input($project);\n \tif (!defined($project)) {\n-- \n1.3.0\n"},{"id":"22214","messageId":"11509022191149-git-send-email-jnareb@gmail.com","threadId":"4605","inReplyTo":"11509012742493-git-send-email-jnareb@gmail.com","subject":"[PATCH (amend)] gitweb: Make use of $PATH_INFO for project parameter","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-06-21T15:03:39Z","receivedAt":"2006-06-21T15:03:39Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Allow to have project name in the path part of URL, just after the name of\nscript. For example instead of gitweb.cgi?p=git.git you can write\ngitweb.cgi/git.git or gitweb.cgi/git.git/\n\nNot used in URLs inside gitweb; it means that the above alternate syntax\nmust be generated by hand, at least for now.\n\nSide effect: project name parameter is now stripped of leading and\ntrailing slash before validation.\n\nSigned-off-by: Jakub Narebski <jnareb@gmail.com>\n\n---\n\n gitweb/gitweb.cgi |    3 ++-\n 1 files changed, 2 insertions(+), 1 deletions(-)\n\n63ffc79283d23aeedbdc259e3b069f1e97498e09\ndiff --git a/gitweb/gitweb.cgi b/gitweb/gitweb.cgi\nindex e044c61..91698df 100755\n--- a/gitweb/gitweb.cgi\n+++ b/gitweb/gitweb.cgi\n@@ -86,7 +86,8 @@ if (defined $order) {\n \t}\n }\n \n-my $project = $cgi->param('p');\n+my $project = ($cgi->param('p') || $ENV{'PATH_INFO'});\n+$project =~ s|^/||; $project =~ s|/$||;\n if (defined $project) {\n \t$project = validate_input($project);\n \tif (!defined($project)) {\n-- \n1.3.0\n"},{"id":"22215","messageId":"11509023994002-git-send-email-jnareb@gmail.com","threadId":"4605","inReplyTo":"11509012742493-git-send-email-jnareb@gmail.com","subject":"[PATCH] gitweb: Make use of $PATH_INFO for project parameter","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-06-21T15:06:39Z","receivedAt":"2006-06-21T15:06:39Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Allow to have project name in the path part of URL, just after the name of\nscript. For example instead of gitweb.cgi?p=git.git you can write\ngitweb.cgi/git.git or gitweb.cgi/git.git/\n\nNot used in URLs inside gitweb; it means that the above alternate syntax\nmust be generated by hand, at least for now.\n\nSide effect: project name parameter is now stripped of leading and\ntrailing slash before validation.\n\nSigned-off-by: Jakub Narebski <jnareb@gmail.com>\n\n---\nThis is final, correct version of the patch.\n\n gitweb/gitweb.cgi |    3 ++-\n 1 files changed, 2 insertions(+), 1 deletions(-)\n\nb9df055ae8d3aafe03744537026823dbaf7342ba\ndiff --git a/gitweb/gitweb.cgi b/gitweb/gitweb.cgi\nindex e044c61..e2108de 100755\n--- a/gitweb/gitweb.cgi\n+++ b/gitweb/gitweb.cgi\n@@ -86,8 +86,9 @@ if (defined $order) {\n \t}\n }\n \n-my $project = $cgi->param('p');\n+my $project = ($cgi->param('p') || $ENV{'PATH_INFO'});\n if (defined $project) {\n+\t$project =~ s|^/||; $project =~ s|/$||;\n \t$project = validate_input($project);\n \tif (!defined($project)) {\n \t\tdie_error(undef, \"Invalid project parameter.\");\n-- \n1.3.0\n"}]}