To make sure git_repos displayed on the web are right.
examples: a/AvxToNeon/AvxToNeon aur-a/a2png/a2png m/my-sql_with_boostkit_patch/my-sql_with_boostkit_patch
Signed-off-by: Li Yuanchao lyc163mail@163.com --- src/lib/web_backend.rb | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/src/lib/web_backend.rb b/src/lib/web_backend.rb index cbf6e5c..0c1f4fa 100644 --- a/src/lib/web_backend.rb +++ b/src/lib/web_backend.rb @@ -403,6 +403,8 @@ def query_repos(must, from: 0, size: 1) repos = [] result['hits']['hits'].each do |r| r = r['_source'] + next unless r['git_repo'] =~ %r{^([a-z0-9]([a-z0-9-_]*[a-z0-9])*(/[a-zA-Z0-9][\w-]*[a-zA-Z0-9]){2})$} + repos << { git_url: get_repo_url(r['url']), git_repo: r['git_repo']