Skip to content

Commit c0abe11

Browse files
committed
Fix a syntax error in a regexp.
Query GitHub with "open" in lowercase also when the user's command says "OPEN" in uppercase,
1 parent 52b96a6 commit c0abe11

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

ghurlbot.pl

+6-2
Original file line numberDiff line numberDiff line change
@@ -1607,7 +1607,11 @@ ($$$$$$$$$)
16071607
$labels =~ s/ //g if $labels;
16081608
$labels = $labels ? "$labels,action" : "action" if lc $type eq 'actions';
16091609
$max = $full ? $self->{maxlines}->{$channel} // DEFAULT_MAXLINES : MAX;
1610-
$q = "per_page=$max&state=$state";
1610+
$q = "&per_page=$max";
1611+
if ($state =~ /^open$/i) {$q .= "&state=open"}
1612+
elsif ($state =~ /^closed$/i) {$q .= "&state=closed"}
1613+
elsif ($state =~ /^all$/i) {$q .= "&state=all"}
1614+
else {return "Sorry, you found a bug! (Unhandled \$state in find_issues.)"}
16111615
$creator = $who if $creator && $creator =~ /^m[ey]$/i;
16121616
$assignee = $who if $assignee && $assignee =~ /^m[ey]$/i;
16131617
$q .= "&assignee=" . esc($self->name_to_login($assignee)) if $assignee;
@@ -2079,7 +2083,7 @@ ($)
20792083
my ($octets);
20802084

20812085
$octets = encode("UTF-8", $s);
2082-
$octets =~ s/([^A-Za-z0-9._~!$'()*,=:@\/-])/"%".sprintf("%02x",ord($1))/eg;
2086+
$octets =~ s/([^A-Za-z0-9._~!\$'()*,=:@\/-])/"%".sprintf("%02x",ord($1))/eg;
20832087
return decode("UTF-8", $octets);
20842088
}
20852089

0 commit comments

Comments
 (0)