@@ -392,26 +392,7 @@ func Issues(ctx *context.Context) {
392
392
}
393
393
394
394
// Parse ctx.Query("repos") -- gets set when clicking filters -- and remember matched repo IDs for later.
395
- reposQuery := ctx .Query ("repos" )
396
- var repoIDs []int64
397
- if len (reposQuery ) != 0 {
398
- if issueReposQueryPattern .MatchString (reposQuery ) {
399
- // remove "[" and "]" from string
400
- reposQuery = reposQuery [1 : len (reposQuery )- 1 ]
401
- //for each ID (delimiter ",") add to int to repoIDs
402
- for _ , rID := range strings .Split (reposQuery , "," ) {
403
- // Ensure nonempty string entries
404
- if rID != "" && rID != "0" {
405
- rIDint64 , err := strconv .ParseInt (rID , 10 , 64 )
406
- if err == nil {
407
- repoIDs = append (repoIDs , rIDint64 )
408
- }
409
- }
410
- }
411
- } else {
412
- log .Warn ("issueReposQueryPattern not match with query" )
413
- }
414
- }
395
+ repoIDs := repoIDs (ctx .Query ("repos" ))
415
396
416
397
// No idea what this means.
417
398
isShowClosed := ctx .Query ("state" ) == "closed"
@@ -719,6 +700,29 @@ func Issues(ctx *context.Context) {
719
700
ctx .HTML (200 , tplIssues )
720
701
}
721
702
703
+ func repoIDs (reposQuery string ) []int64 {
704
+ var repoIDs []int64
705
+ if len (reposQuery ) != 0 {
706
+ if issueReposQueryPattern .MatchString (reposQuery ) {
707
+ // remove "[" and "]" from string
708
+ reposQuery = reposQuery [1 : len (reposQuery )- 1 ]
709
+ //for each ID (delimiter ",") add to int to repoIDs
710
+ for _ , rID := range strings .Split (reposQuery , "," ) {
711
+ // Ensure nonempty string entries
712
+ if rID != "" && rID != "0" {
713
+ rIDint64 , err := strconv .ParseInt (rID , 10 , 64 )
714
+ if err == nil {
715
+ repoIDs = append (repoIDs , rIDint64 )
716
+ }
717
+ }
718
+ }
719
+ } else {
720
+ log .Warn ("issueReposQueryPattern not match with query" )
721
+ }
722
+ }
723
+ return repoIDs
724
+ }
725
+
722
726
// ShowSSHKeys output all the ssh keys of user by uid
723
727
func ShowSSHKeys (ctx * context.Context , uid int64 ) {
724
728
keys , err := models .ListPublicKeys (uid , models.ListOptions {})
0 commit comments