Commit 06108030 authored by Francois Cartegnie's avatar Francois Cartegnie

lua http: fix valid uri handling with v2.

Correct uri are not escaped, so we must not unescape them.
Adding a version query string for our web intf to keep backward compatibility.
parent fb9bbdc9
...@@ -195,7 +195,7 @@ function browse(dir){ ...@@ -195,7 +195,7 @@ function browse(dir){
case '#mobile': case '#mobile':
break; break;
default: default:
sendCommand('command=in_play&input='+encodeURIComponent($(this).attr('openfile'))); sendCommand('command=in_play&v=2&input='+encodeURIComponent($(this).attr('openfile')));
break; break;
} }
$('#window_browse').dialog('close'); $('#window_browse').dialog('close');
...@@ -212,7 +212,7 @@ function browse(dir){ ...@@ -212,7 +212,7 @@ function browse(dir){
$('[openfile]').click(function(){ $('[openfile]').click(function(){
switch(tgt){ switch(tgt){
case '#mobile': case '#mobile':
sendCommand('command=in_play&input='+encodeURIComponent($(this).attr('openfile')),"window.location='mobile.html'"); sendCommand('command=in_play&v=2&input='+encodeURIComponent($(this).attr('openfile')),"window.location='mobile.html'");
break; break;
default: default:
break; break;
......
...@@ -71,10 +71,12 @@ processcommands = function () ...@@ -71,10 +71,12 @@ processcommands = function ()
local input = _GET['input'] local input = _GET['input']
local command = _GET['command'] local command = _GET['command']
local version = tonumber(_GET['v'] or 1)
local id = tonumber(_GET['id'] or -1) local id = tonumber(_GET['id'] or -1)
local val = _GET['val'] local val = _GET['val']
local options = _GET['option'] local options = _GET['option']
local band = _GET['band'] local band = _GET['band']
local decodedpath
if type(options) ~= "table" then -- Deal with the 0 or 1 option case if type(options) ~= "table" then -- Deal with the 0 or 1 option case
options = { options } options = { options }
end end
...@@ -87,11 +89,16 @@ processcommands = function () ...@@ -87,11 +89,16 @@ processcommands = function ()
end end
vlc.msg.err( "</options>" ) vlc.msg.err( "</options>" )
--]] --]]
vlc.playlist.add({{path=stripslashes(input),options=options}}) if version == 2 then
decodedpath = input
else
decodedpath = stripslashes(input)
end
vlc.playlist.add({{path=decodedpath,options=options}})
elseif command == "addsubtitle" then elseif command == "addsubtitle" then
vlc.input.add_subtitle (stripslashes(val)) vlc.input.add_subtitle (stripslashes(val))
elseif command == "in_enqueue" then elseif command == "in_enqueue" then
vlc.playlist.enqueue({{path=stripslashes(input),options=options}}) vlc.playlist.enqueue({{path=decodedpath,options=options}})
elseif command == "pl_play" then elseif command == "pl_play" then
if id == -1 then if id == -1 then
vlc.playlist.play() vlc.playlist.play()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment