mirror of
https://github.com/jellyfin/jellyfin-roku.git
synced 2024-11-23 06:09:41 +00:00
validate data before sending to isLocalHost() to prevent app crash
This commit is contained in:
parent
d7c99f508f
commit
4ec187d17b
@ -350,11 +350,15 @@ sub addVideoContentURL(video, mediaSourceId, audio_stream_idx, fully_external)
|
||||
protocol = LCase(m.playbackInfo.MediaSources[0].Protocol)
|
||||
if protocol <> "file"
|
||||
uri = parseUrl(m.playbackInfo.MediaSources[0].Path)
|
||||
if isLocalhost(uri[2])
|
||||
if not isValidAndNotEmpty(uri) then return
|
||||
|
||||
if isValid(uri[2]) and isLocalhost(uri[2])
|
||||
' if the domain of the URI is local to the server,
|
||||
' create a new URI by appending the received path to the server URL
|
||||
' later we will substitute the users provided URL for this case
|
||||
video.content.url = buildURL(uri[4])
|
||||
if isValid(uri[4])
|
||||
video.content.url = buildURL(uri[4])
|
||||
end if
|
||||
else
|
||||
fully_external = true
|
||||
video.content.url = m.playbackInfo.MediaSources[0].Path
|
||||
|
@ -263,16 +263,20 @@ sub AddVideoContent(video as object, mediaSourceId as dynamic, audio_stream_idx
|
||||
protocol = LCase(m.playbackInfo.MediaSources[0].Protocol)
|
||||
if protocol <> "file"
|
||||
uri = parseUrl(m.playbackInfo.MediaSources[0].Path)
|
||||
if isLocalhost(uri[2])
|
||||
if not isValidAndNotEmpty(uri) then return
|
||||
|
||||
if isValid(uri[2]) and isLocalhost(uri[2])
|
||||
' the domain of the URI is local to the server.
|
||||
' create a new URI by appending the received path to the server URL
|
||||
' later we will substitute the users provided URL for this case
|
||||
video.content.url = buildURL(uri[4])
|
||||
if isValid(uri[4])
|
||||
video.content.url = buildURL(uri[4])
|
||||
end if
|
||||
else
|
||||
fully_external = true
|
||||
video.content.url = m.playbackInfo.MediaSources[0].Path
|
||||
end if
|
||||
else:
|
||||
else
|
||||
params.append({
|
||||
"Static": "true",
|
||||
"Container": video.container,
|
||||
|
Loading…
Reference in New Issue
Block a user