Skip to content

Commit

Permalink
Encode quotes in url. Fixes #567
Browse files Browse the repository at this point in the history
  • Loading branch information
ljunkie committed Jul 27, 2015
1 parent ab3665e commit 943da05
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Plex/source/PlexMediaServer.brs
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,17 @@ End Function
'* source URL, and absolute URLs, so
'* relative to the server URL
Function FullUrl(serverUrl, sourceUrl, key) As String
' Replace quotes
if instr(1, tostr(key), """") > 0 then
rQuote = CreateObject("roRegex", """", "")
key = rQuote.ReplaceAll(key, HttpEncode(""""))
end if

if instr(1, tostr(sourceUrl), """") > 0 then
rQuote = CreateObject("roRegex", """", "")
sourceUrl = rQuote.ReplaceAll(sourceUrl, HttpEncode(""""))
end if

finalUrl = ""
if key <> invalid and (left(key, 4) = "http" OR left(key, 4) = "rtmp") then
return key
Expand Down

0 comments on commit 943da05

Please sign in to comment.