[vlc-devel] [PATCH] Disable lua-precessig in locally stored js-files. Many js-scripts (e.g. JQuery) contains regular expressions that incorrect processed in the process_raw function. This commit disable lua-processing for .js files.

Rémi Denis-Courmont remi at remlab.net
Fri Jul 12 14:30:56 CEST 2019


Hi,

I don't follow the logic here. You can't assume that file type always matches the file extension.

Le 12 juillet 2019 14:06:51 GMT+03:00, Alexandr Koverninsky <a.koverninsky at gmail.com> a écrit :
>---
> share/lua/intf/http.lua | 4 ++++
> 1 file changed, 4 insertions(+)
>
>diff --git a/share/lua/intf/http.lua b/share/lua/intf/http.lua
>index fc6d1a3156..d40f423bee 100644
>--- a/share/lua/intf/http.lua
>+++ b/share/lua/intf/http.lua
>@@ -78,6 +78,10 @@ function process_raw(filename)
>     --]]
>local code0 = string.gsub(input,escape(close_tag)," print(["..str.."[")
>     local code1 = string.gsub(code0,escape(open_tag),"]"..str.."]) ")
>+    local fileext=filename:match("^.+(%..+)$")
>+    if fileext == ".js" then
>+      code1=input;
>+    end
>     local code = "print(["..str.."["..code1.."]"..str.."])"
>     --[[ Uncomment to debug
>     if string.match(filename,"vlm_cmd.xml$") then
>-- 
>2.19.1.windows.1
>
>_______________________________________________
>vlc-devel mailing list
>To unsubscribe or modify your subscription options:
>https://mailman.videolan.org/listinfo/vlc-devel

-- 
Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20190712/04874485/attachment.html>


More information about the vlc-devel mailing list