Bugzilla – Attachment 113225 Details for
Bug 24633
Add support for gitlab searching of plugins
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24633: URI escape the search term
Bug-24633-URI-escape-the-search-term.patch (text/plain), 2.10 KB, created by
Jonathan Druart
on 2020-11-06 10:44:07 UTC
(
hide
)
Description:
Bug 24633: URI escape the search term
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2020-11-06 10:44:07 UTC
Size:
2.10 KB
patch
obsolete
>From 6dbe00ae8473bff1b48fefba346336ebcc452c7c Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 6 Nov 2020 11:41:35 +0100 >Subject: [PATCH] Bug 24633: URI escape the search term > >--- > plugins/plugins-home.pl | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > >diff --git a/plugins/plugins-home.pl b/plugins/plugins-home.pl >index f9d72b885d..1e10c2acdc 100755 >--- a/plugins/plugins-home.pl >+++ b/plugins/plugins-home.pl >@@ -23,6 +23,7 @@ use CGI qw ( -utf8 ); > > use JSON qw(from_json); > use LWP::Simple qw(get); >+use URI::Escape qw( uri_escape_utf8 ); > > use Koha::Plugins; > use C4::Auth; >@@ -72,9 +73,10 @@ if ($plugins_enabled) { > $repos = { repo => [ $repos->{repo} ] }; > } > >+ my $plugin_search_uri = uri_escape_utf8( $plugin_search ); > foreach my $r ( @{ $repos->{repo} } ) { > if ( $r->{service} eq 'github' ) { >- my $url = "https://api.github.com/search/repositories?q=$plugin_search+user:$r->{org_name}+in:name,description"; >+ my $url = "https://api.github.com/search/repositories?q=$plugin_search_uri+user:$r->{org_name}+in:name,description"; > my $response = from_json( get($url) ); > foreach my $result ( @{ $response->{items} } ) { > next unless $result->{name} =~ /^koha-plugin-/; >@@ -91,7 +93,7 @@ if ($plugins_enabled) { > } > elsif ( $r->{service} eq 'gitlab' ) { > my $org_name = $r->{org_name}; >- my $url = "https://gitlab.com/api/v4/groups/$org_name/projects?with_issues_enabled=no\&with_merge_requests_enabled=no\&with_shared=no\&include_subgroups=yes\&search=koha-plugin+$plugin_search"; >+ my $url = "https://gitlab.com/api/v4/groups/$org_name/projects?with_issues_enabled=no\&with_merge_requests_enabled=no\&with_shared=no\&include_subgroups=yes\&search=koha-plugin+$plugin_search_uri"; > my $response = from_json( get($url) ); > foreach my $result ( @{ $response } ) { > next unless $result->{name} =~ /^koha-plugin-/; >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 24633
:
112066
|
112067
|
112068
|
112069
|
112074
|
112075
|
112097
|
112098
|
113224
|
113225
|
133439
|
133440
|
133441
|
133442
|
133443
|
133444