mirror of
https://github.com/iv-org/invidious.git
synced 2025-08-13 16:18:29 +00:00
Prevent page variable being lower than 0
This commit is contained in:
parent
37ad62e93d
commit
c972647ae7
@ -2521,7 +2521,7 @@ get "/api/v1/channels/search/:ucid" do |env|
|
|||||||
query ||= ""
|
query ||= ""
|
||||||
|
|
||||||
page = env.params.query["page"]?.try &.to_i?
|
page = env.params.query["page"]?.try &.to_i?
|
||||||
page ||= 1
|
page = 1 if !page || page <= 0
|
||||||
|
|
||||||
count, search_results = channel_search(query, page, ucid)
|
count, search_results = channel_search(query, page, ucid)
|
||||||
JSON.build do |json|
|
JSON.build do |json|
|
||||||
|
Loading…
Reference in New Issue
Block a user