Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
gitweb: Don't undefine query parameter related variables before die_error
author
Jakub Narebski
<jnareb@gmail.com>
Sat, 5 Aug 2006 10:58:06 +0000
(12:58 +0200)
committer
Junio C Hamano
<junkio@cox.net>
Sun, 6 Aug 2006 08:53:38 +0000
(
01:53
-0700)
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
gitweb/gitweb.perl
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
623e4ae
)
diff --git
a/gitweb/gitweb.perl
b/gitweb/gitweb.perl
index c11c2f2b7094f749312a304a026419d1d26c75a3..89ceb9765dcaa9573cb1825433d4457ef76aa0fe 100755
(executable)
--- a/
gitweb/gitweb.perl
+++ b/
gitweb/gitweb.perl
@@
-76,7
+76,6
@@
our $action = $cgi->param('a');
if (defined $action) {
if ($action =~ m/[^0-9a-zA-Z\.\-_]/) {
our $action = $cgi->param('a');
if (defined $action) {
if ($action =~ m/[^0-9a-zA-Z\.\-_]/) {
- undef $action;
die_error(undef, "Invalid action parameter.");
}
# action which does not check rest of parameters
die_error(undef, "Invalid action parameter.");
}
# action which does not check rest of parameters
@@
-89,16
+88,13
@@
our $project = ($cgi->param('p') || $ENV{'PATH_INFO'});
if (defined $project) {
$project =~ s|^/||; $project =~ s|/$||;
our $project = ($cgi->param('p') || $ENV{'PATH_INFO'});
if (defined $project) {
$project =~ s|^/||; $project =~ s|/$||;
- $project = validate_input($project);
- if (!defined($project)) {
+ if (!validate_input($project)) {
die_error(undef, "Invalid project parameter.");
}
if (!(-d "$projectroot/$project")) {
die_error(undef, "Invalid project parameter.");
}
if (!(-d "$projectroot/$project")) {
- undef $project;
die_error(undef, "No such directory.");
}
if (!(-e "$projectroot/$project/HEAD")) {
die_error(undef, "No such directory.");
}
if (!(-e "$projectroot/$project/HEAD")) {
- undef $project;
die_error(undef, "No such project.");
}
$rss_link = "<link rel=\"alternate\" title=\"" . esc_param($project) . " log\" href=\"" .
die_error(undef, "No such project.");
}
$rss_link = "<link rel=\"alternate\" title=\"" . esc_param($project) . " log\" href=\"" .
@@
-111,32
+107,28
@@
our $file_name = $cgi->param('f');
if (defined $file_name) {
our $file_name = $cgi->param('f');
if (defined $file_name) {
- $file_name = validate_input($file_name);
- if (!defined($file_name)) {
+ if (!validate_input($file_name)) {
die_error(undef, "Invalid file parameter.");
}
}
our $hash = $cgi->param('h');
if (defined $hash) {
die_error(undef, "Invalid file parameter.");
}
}
our $hash = $cgi->param('h');
if (defined $hash) {
- $hash = validate_input($hash);
- if (!defined($hash)) {
+ if (!validate_input($hash)) {
die_error(undef, "Invalid hash parameter.");
}
}
our $hash_parent = $cgi->param('hp');
if (defined $hash_parent) {
die_error(undef, "Invalid hash parameter.");
}
}
our $hash_parent = $cgi->param('hp');
if (defined $hash_parent) {
- $hash_parent = validate_input($hash_parent);
- if (!defined($hash_parent)) {
+ if (!validate_input($hash_parent)) {
die_error(undef, "Invalid hash parent parameter.");
}
}
our $hash_base = $cgi->param('hb');
if (defined $hash_base) {
die_error(undef, "Invalid hash parent parameter.");
}
}
our $hash_base = $cgi->param('hb');
if (defined $hash_base) {
- $hash_base = validate_input($hash_base);
- if (!defined($hash_base)) {
+ if (!validate_input($hash_base)) {
die_error(undef, "Invalid hash base parameter.");
}
}
die_error(undef, "Invalid hash base parameter.");
}
}
@@
-144,7
+136,6
@@
our $page = $cgi->param('pg');
if (defined $page) {
if ($page =~ m/[^0-9]$/) {
our $page = $cgi->param('pg');
if (defined $page) {
if ($page =~ m/[^0-9]$/) {
- undef $page;
die_error(undef, "Invalid page parameter.");
}
}
die_error(undef, "Invalid page parameter.");
}
}
@@
-152,7
+143,6
@@
our $searchtext = $cgi->param('s');
if (defined $searchtext) {
if ($searchtext =~ m/[^a-zA-Z0-9_\.\/\-\+\:\@ ]/) {
our $searchtext = $cgi->param('s');
if (defined $searchtext) {
if ($searchtext =~ m/[^a-zA-Z0-9_\.\/\-\+\:\@ ]/) {
- undef $searchtext;
die_error(undef, "Invalid search parameter.");
}
$searchtext = quotemeta $searchtext;
die_error(undef, "Invalid search parameter.");
}
$searchtext = quotemeta $searchtext;
@@
-182,7
+172,6
@@
$action = 'summary' if (!defined($action));
if (!defined($actions{$action})) {
$action = 'summary' if (!defined($action));
if (!defined($actions{$action})) {
- undef $action;
die_error(undef, "Unknown action.");
}
$actions{$action}->();
die_error(undef, "Unknown action.");
}
$actions{$action}->();