summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
inline | side by side (from parent 1:
ad73a35)
Currently, there are rather draconian restrictions on the strings accepted
by the pickaxe search, which degrades its usefulness for digging in code
significantly. This patch remedies mentioned limitation.
Signed-off-by: Petr Baudis <redacted>
Signed-off-by: Junio C Hamano <redacted>
our $searchtext = $cgi->param('s');
our $search_regexp;
if (defined $searchtext) {
our $searchtext = $cgi->param('s');
our $search_regexp;
if (defined $searchtext) {
- if ($searchtype ne 'grep' and $searchtext =~ m/[^a-zA-Z0-9_\.\/\-\+\:\@ ]/) {
+ if ($searchtype ne 'grep' and $searchtype ne 'pickaxe' and $searchtext =~ m/[^a-zA-Z0-9_\.\/\-\+\:\@ ]/) {
die_error(undef, "Invalid search parameter");
}
if (length($searchtext) < 2) {
die_error(undef, "Invalid search parameter");
}
if (length($searchtext) < 2) {
my $alternate = 1;
$/ = "\n";
my $git_command = git_cmd_str();
my $alternate = 1;
$/ = "\n";
my $git_command = git_cmd_str();
+ my $searchqtext = $searchtext;
+ $searchqtext =~ s/'/'\\''/;
open my $fd, "-|", "$git_command rev-list $hash | " .
open my $fd, "-|", "$git_command rev-list $hash | " .
- "$git_command diff-tree -r --stdin -S\'$searchtext\'";
+ "$git_command diff-tree -r --stdin -S\'$searchqtext\'";
undef %co;
my @files;
while (my $line = <$fd>) {
undef %co;
my @files;
while (my $line = <$fd>) {