mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2023-06-08.git
synced 2024-08-15 00:53:38 +00:00
Fix input validation
This commit is contained in:
parent
a5cc66e060
commit
0b17f68eba
1 changed files with 2 additions and 2 deletions
|
@ -82,7 +82,7 @@ module Invidious::Routes::API::V1::Authenticated
|
||||||
end
|
end
|
||||||
|
|
||||||
id = env.params.url["id"]
|
id = env.params.url["id"]
|
||||||
if !id.match(/[a-zA-Z0-9_-]{11}/)
|
if !id.match(/^[a-zA-Z0-9_-]{11}$/)
|
||||||
return error_json(400, "Invalid video id.")
|
return error_json(400, "Invalid video id.")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -98,7 +98,7 @@ module Invidious::Routes::API::V1::Authenticated
|
||||||
end
|
end
|
||||||
|
|
||||||
id = env.params.url["id"]
|
id = env.params.url["id"]
|
||||||
if !id.match(/[a-zA-Z0-9_-]{11}/)
|
if !id.match(/^[a-zA-Z0-9_-]{11}$/)
|
||||||
return error_json(400, "Invalid video id.")
|
return error_json(400, "Invalid video id.")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue