From b1ccd6ddc316af87a31531d733ef897a0cc2baac Mon Sep 17 00:00:00 2001 From: Marvin Scholz Date: Tue, 25 Oct 2016 13:40:32 +0200 Subject: [PATCH] soundcloud.lua: Improve URL probe function MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Improve the URL probe function to not match URLs like http://example.org/foo/soundcloud.com/example/example as those should not be handled by this script. Ref. #17488 Acked-by: Filip Roséen Signed-off-by: Rémi Denis-Courmont --- share/lua/playlist/soundcloud.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/share/lua/playlist/soundcloud.lua b/share/lua/playlist/soundcloud.lua index 8dfbe7e4ed..fbf8faf254 100644 --- a/share/lua/playlist/soundcloud.lua +++ b/share/lua/playlist/soundcloud.lua @@ -23,8 +23,10 @@ -- Probe function. function probe() + local path = vlc.path + path = path:gsub("^www%.", "") return ( vlc.access == "http" or vlc.access == "https" ) - and string.match( vlc.path, "soundcloud%.com/.+/.+" ) + and string.match( path, "^soundcloud%.com/.+/.+" ) end function fix_quotes( value ) -- 2.20.1