mirror of
https://gitea.invidious.io/iv-org/invidious.git
synced 2024-08-15 00:53:41 +00:00
Sanitize input to decode_length_seconds
This commit is contained in:
parent
202de1436d
commit
a1225b6d0d
1 changed files with 1 additions and 1 deletions
|
@ -1675,7 +1675,7 @@ def make_client(url : URI, region = nil)
|
||||||
end
|
end
|
||||||
|
|
||||||
def decode_length_seconds(string)
|
def decode_length_seconds(string)
|
||||||
length_seconds = string.split(":").map { |a| a.to_i }
|
length_seconds = string.gsub(/[^0-9:]/, "").split(":").map &.to_i
|
||||||
length_seconds = [0] * (3 - length_seconds.size) + length_seconds
|
length_seconds = [0] * (3 - length_seconds.size) + length_seconds
|
||||||
length_seconds = Time::Span.new(length_seconds[0], length_seconds[1], length_seconds[2])
|
length_seconds = Time::Span.new(length_seconds[0], length_seconds[1], length_seconds[2])
|
||||||
length_seconds = length_seconds.total_seconds.to_i
|
length_seconds = length_seconds.total_seconds.to_i
|
||||||
|
|
Loading…
Reference in a new issue