[vlc-commits] http.lua: Fix parsing problem.
Alexandr Koverninsky
git at videolan.org
Fri Aug 7 19:10:07 CEST 2020
vlc/vlc-3.0 | branch: master | Alexandr Koverninsky <a.koverninsky at gmail.com> | Mon Jul 15 16:25:53 2019 +0300| [e96fab36f456b113ab7ffbeff6084d0eb2f7dafa] | committer: Pierre Ynard
http.lua: Fix parsing problem.
The closing '?>' needs to be printed using '?<?vlc print ">" ?>' to prevent a parse error.
Signed-off-by: Rémi Denis-Courmont <remi at remlab.net>
(cherry picked from commit d26e4b793c48c67bbb6f82beab2db8e620d7c2aa)
Signed-off-by: Pierre Ynard <linkfanel at yahoo.fr>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=e96fab36f456b113ab7ffbeff6084d0eb2f7dafa
---
share/lua/http/js/jquery.jstree.js | 4 ++--
share/lua/http/requests/browse.xml | 2 +-
share/lua/http/requests/playlist.xml | 2 +-
share/lua/http/requests/playlist_jstree.xml | 2 +-
share/lua/http/requests/status.xml | 2 +-
share/lua/http/requests/vlm.xml | 4 ++--
share/lua/http/requests/vlm_cmd.xml | 4 ++--
share/lua/intf/http.lua | 7 ++-----
8 files changed, 12 insertions(+), 15 deletions(-)
diff --git a/share/lua/http/js/jquery.jstree.js b/share/lua/http/js/jquery.jstree.js
index 59e49296d7..a47e949c65 100644
--- a/share/lua/http/js/jquery.jstree.js
+++ b/share/lua/http/js/jquery.jstree.js
@@ -3027,7 +3027,7 @@
return false;
};
var xsl = {
- 'nest' : '<' + '?xml version="1.0" encoding="utf-8" ?<?vlc print '>'?>' +
+ 'nest' : '<' + '?xml version="1.0" encoding="utf-8" ?>' +
'<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >' +
'<xsl:output method="html" encoding="utf-8" omit-xml-declaration="yes" standalone="no" indent="no" media-type="text/html" />' +
'<xsl:template match="/">' +
@@ -3088,7 +3088,7 @@
'</xsl:template>' +
'</xsl:stylesheet>',
- 'flat' : '<' + '?xml version="1.0" encoding="utf-8" ?<?vlc print '>'?>' +
+ 'flat' : '<' + '?xml version="1.0" encoding="utf-8" ?>' +
'<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >' +
'<xsl:output method="html" encoding="utf-8" omit-xml-declaration="yes" standalone="no" indent="no" media-type="text/xml" />' +
'<xsl:template match="/">' +
diff --git a/share/lua/http/requests/browse.xml b/share/lua/http/requests/browse.xml
index 0afff8f090..59ac5c3c34 100644
--- a/share/lua/http/requests/browse.xml
+++ b/share/lua/http/requests/browse.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes" ?<?vlc print'>'?>
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<?vlc --[[
vim:syntax=lua
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >
diff --git a/share/lua/http/requests/playlist.xml b/share/lua/http/requests/playlist.xml
index 8b8930b657..7cbcd75baa 100644
--- a/share/lua/http/requests/playlist.xml
+++ b/share/lua/http/requests/playlist.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes" ?<?vlc print'>'?>
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<?vlc --[[
vim:syntax=lua
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >
diff --git a/share/lua/http/requests/playlist_jstree.xml b/share/lua/http/requests/playlist_jstree.xml
index 4281117787..d99c495256 100644
--- a/share/lua/http/requests/playlist_jstree.xml
+++ b/share/lua/http/requests/playlist_jstree.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes" ?<?vlc print'>'?>
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<?vlc --[[
vim:syntax=lua
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >
diff --git a/share/lua/http/requests/status.xml b/share/lua/http/requests/status.xml
index d3e468d798..7825c0b41e 100644
--- a/share/lua/http/requests/status.xml
+++ b/share/lua/http/requests/status.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes" ?<?vlcprint'>'?>
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<?vlc --[[
vim:syntax=lua
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >
diff --git a/share/lua/http/requests/vlm.xml b/share/lua/http/requests/vlm.xml
index 27173bb6df..b724a3ab9f 100644
--- a/share/lua/http/requests/vlm.xml
+++ b/share/lua/http/requests/vlm.xml
@@ -1,5 +1,5 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes" ?<?vlc print '>'
---[[
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<?vlc --[[
vim:syntax=lua
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >
< vlm.xml: VLC media player web interface
diff --git a/share/lua/http/requests/vlm_cmd.xml b/share/lua/http/requests/vlm_cmd.xml
index 10a9a4a42b..fb6af4790a 100644
--- a/share/lua/http/requests/vlm_cmd.xml
+++ b/share/lua/http/requests/vlm_cmd.xml
@@ -1,5 +1,5 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes" ?<?vlc print '>'
---[[
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<?vlc --[[
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >
< vlm_cmd.xml: VLC media player web interface
< - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >
diff --git a/share/lua/intf/http.lua b/share/lua/intf/http.lua
index 5367ea08c1..9841d9bab8 100644
--- a/share/lua/intf/http.lua
+++ b/share/lua/intf/http.lua
@@ -73,11 +73,8 @@ function process_raw(filename)
end
str=string.rep("=",#str-1)
- --[[ FIXME:
- <?xml version="1.0" encoding="charset" standalone="yes" ?> is still a problem. The closing '?>' needs to be printed using '?<?vlc print ">" ?>' to prevent a parse error.
- --]]
- local code0 = string.gsub(input,escape(close_tag)," print(["..str.."[")
- local code1 = string.gsub(code0,escape(open_tag),"]"..str.."]) ")
+ local code0 = string.gsub(input,escape(open_tag),"]"..str.."]) ")
+ local code1 = string.gsub(code0,"(%]"..str.."%]%) "..".-)("..escape(close_tag)..")","%1 print(["..str.."[")
local code = "print(["..str.."["..code1.."]"..str.."])"
--[[ Uncomment to debug
if string.match(filename,"vlm_cmd.xml$") then
More information about the vlc-commits
mailing list