Fix searching for unsplash pictures with words that contain a space
This commit is contained in:
parent
912abb3a10
commit
be11362533
1 changed files with 2 additions and 1 deletions
|
@ -26,6 +26,7 @@ import (
|
||||||
"code.vikunja.io/web"
|
"code.vikunja.io/web"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"net/url"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
@ -196,7 +197,7 @@ func (p *Provider) Search(search string, page int64) (result []*background.Image
|
||||||
}
|
}
|
||||||
|
|
||||||
searchResult := &SearchResult{}
|
searchResult := &SearchResult{}
|
||||||
err = doGet("search/photos?query="+search+"&page="+strconv.FormatInt(page, 10)+"&per_page=25", &searchResult)
|
err = doGet("search/photos?query="+url.QueryEscape(search)+"&page="+strconv.FormatInt(page, 10)+"&per_page=25", &searchResult)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue