[vlc-devel] [PATCH] lua/http: remove bad conversion from URL to file path of VLM input

Pierre Ynard linkfanel at yahoo.fr
Wed Nov 2 04:09:45 CET 2016


The conversion is pointless, limiting, unsafe, error-prone and indeed
buggy as it's done in a naive way oblivious of Windows file URL schemes.

Fixes #14842

Someone please test on Windows especially, otherwise I'll just push it
as untested.


diff --git a/share/lua/http/index.html b/share/lua/http/index.html
index bf831c9..211fa08 100644
--- a/share/lua/http/index.html
+++ b/share/lua/http/index.html
@@ -168,7 +168,7 @@
 					modal: true,
 					buttons:{
 						"<?vlc gettext("Yes") ?>":function(){
-							var file			=	$('[current="current"]','#libraryTree').length>0 ? decodeURIComponent($('[current="current"]','#libraryTree').first().attr('uri').substr(7)) : ($('.jstree-clicked','#libraryTree').length>0 ? decodeURIComponent($('.jstree-clicked','#libraryTree').first().parents().first().attr('uri').substr(7)) : ($('#plid_'+current_id).attr('uri') ? decodeURIComponent($('#plid_'+current_id).attr('uri').substr(7)) : false));
+							var file			=	$('[current="current"]','#libraryTree').length>0 ? $('[current="current"]','#libraryTree').first().attr('uri') : ($('.jstree-clicked','#libraryTree').length>0 ? $('.jstree-clicked','#libraryTree').first().parents().first().attr('uri') : ($('#plid_'+current_id).attr('uri') ? $('#plid_'+current_id).attr('uri') : false));
 							if(file){
 								if($('#viewContainer').css('display')=='none'){
 									$('#buttonViewer').click();


-- 
Pierre Ynard
"Une âme dans un corps, c'est comme un dessin sur une feuille de papier."


More information about the vlc-devel mailing list